Commit 9d17c497 authored by hewei's avatar hewei

issues#54 在注释未采用标准格式添加时(<!--和-->存在其他字符),OptimisticLockerPlugin会出错。

parent edbca726
...@@ -331,8 +331,6 @@ public class LogicalDeletePlugin extends BasePlugin { ...@@ -331,8 +331,6 @@ public class LogicalDeletePlugin extends BasePlugin {
selectByPrimaryKey.addAttribute(new Attribute("parameterType", "map")); selectByPrimaryKey.addAttribute(new Attribute("parameterType", "map"));
context.getCommentGenerator().addComment(selectByPrimaryKey);
sb = new StringBuilder(); sb = new StringBuilder();
sb.append("select "); sb.append("select ");
......
...@@ -215,7 +215,7 @@ public class FormatTools { ...@@ -215,7 +215,7 @@ public class FormatTools {
boolean flag = false; boolean flag = false;
while (elementIterator.hasNext()) { while (elementIterator.hasNext()) {
Element ele = elementIterator.next(); Element ele = elementIterator.next();
if (ele instanceof TextElement && ((TextElement) ele).getContent().matches("<!--")) { if (ele instanceof TextElement && ((TextElement) ele).getContent().matches(".*<!--.*")) {
flag = true; flag = true;
} }
...@@ -223,7 +223,7 @@ public class FormatTools { ...@@ -223,7 +223,7 @@ public class FormatTools {
elementIterator.remove(); elementIterator.remove();
} }
if (ele instanceof TextElement && ((TextElement) ele).getContent().matches("-->")) { if (ele instanceof TextElement && ((TextElement) ele).getContent().matches(".*-->.*")) {
flag = false; flag = false;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment