issues#54 在注释未采用标准格式添加时(<!--和-->存在其他字符),OptimisticLockerPlugin会出错。
This commit is contained in:
@@ -331,8 +331,6 @@ public class LogicalDeletePlugin extends BasePlugin {
|
||||
|
||||
selectByPrimaryKey.addAttribute(new Attribute("parameterType", "map"));
|
||||
|
||||
context.getCommentGenerator().addComment(selectByPrimaryKey);
|
||||
|
||||
sb = new StringBuilder();
|
||||
sb.append("select ");
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ public class FormatTools {
|
||||
boolean flag = false;
|
||||
while (elementIterator.hasNext()) {
|
||||
Element ele = elementIterator.next();
|
||||
if (ele instanceof TextElement && ((TextElement) ele).getContent().matches("<!--")) {
|
||||
if (ele instanceof TextElement && ((TextElement) ele).getContent().matches(".*<!--.*")) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ public class FormatTools {
|
||||
elementIterator.remove();
|
||||
}
|
||||
|
||||
if (ele instanceof TextElement && ((TextElement) ele).getContent().matches("-->")) {
|
||||
if (ele instanceof TextElement && ((TextElement) ele).getContent().matches(".*-->.*")) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user