IDEA-160837 ('<code>...</code> can be replaced with {@code ...}' inspection quick...
authorBas Leijdekkers <basleijdekkers@gmail.com>
Fri, 9 Sep 2016 10:31:15 +0000 (12:31 +0200)
committerBas Leijdekkers <basleijdekkers@gmail.com>
Fri, 9 Sep 2016 11:39:11 +0000 (13:39 +0200)
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/javadoc/HtmlTagCanBeJavadocTagInspection.java
plugins/InspectionGadgets/test/com/siyeh/igfixes/javadoc/html_tag_can_be_javadoc_tag/Lt.after.java [new file with mode: 0644]
plugins/InspectionGadgets/test/com/siyeh/igfixes/javadoc/html_tag_can_be_javadoc_tag/Lt.java [new file with mode: 0644]
plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/javadoc/HtmlTagCanBeJavadocTagFixTest.java

index cf19d33685223c428d0617ed6e6373a5ae80234b..079d0a96b2d6d22d57f127522c1b7c2ef85093ad 100644 (file)
@@ -117,7 +117,8 @@ public class HtmlTagCanBeJavadocTagInspection extends BaseInspection {
       if (out.length() == "{@code".length() && endOffset - startOffset > 0 && !Character.isWhitespace(text.charAt(startOffset))) {
         out.append(' ');
       }
-      out.append(text, startOffset, endOffset);
+      final String s = text.substring(startOffset, endOffset);
+      out.append(StringUtil.unescapeXml(s));
     }
   }
 
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/javadoc/html_tag_can_be_javadoc_tag/Lt.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/javadoc/html_tag_can_be_javadoc_tag/Lt.after.java
new file mode 100644 (file)
index 0000000..68bf50b
--- /dev/null
@@ -0,0 +1,9 @@
+/**
+ * &lt;
+ * {@code 2 < 3}
+ * &gt;
+ */
+class Lt {
+
+
+}
\ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/javadoc/html_tag_can_be_javadoc_tag/Lt.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/javadoc/html_tag_can_be_javadoc_tag/Lt.java
new file mode 100644 (file)
index 0000000..d229879
--- /dev/null
@@ -0,0 +1,9 @@
+/**
+ * &lt;
+ * <caret><code>2 &lt; 3</code>
+ * &gt;
+ */
+class Lt {
+
+
+}
\ No newline at end of file
index 710fe7864b66152abd86f317f76e438f26f99f16..a6676027f4ec7fcd311d6db0bbb8f30e397b1310 100644 (file)
@@ -18,4 +18,5 @@ public class HtmlTagCanBeJavadocTagFixTest extends IGQuickFixesTestCase {
   public void testBraces2() { doTest(); }
   public void testSecond() { doTest(); }
   public void testMultiline() { doTest(); }
+  public void testLt() { doTest(); }
 }
\ No newline at end of file