### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java,v retrieving revision 1.21 diff -u -r1.21 FormatterCommentParser.java --- formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java 8 Jul 2008 10:44:19 -0000 1.21 +++ formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java 19 Aug 2008 16:04:00 -0000 @@ -27,6 +27,7 @@ char[][] htmlTags; int htmlTagsPtr = -1; private boolean invalidTagName; + public boolean parseHtmlTags; public FormatterCommentParser(long sourceLevel) { super(null); @@ -187,6 +188,7 @@ * closing (e.g. ). */ protected boolean parseHtmlTag(int previousPosition, int endTextPosition) throws InvalidInputException { + if (!this.parseHtmlTags) return false; boolean closing = false; boolean valid = false; boolean incremented = false; Index: formatter/org/eclipse/jdt/internal/formatter/Scribe.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/Scribe.java,v retrieving revision 1.147 diff -u -r1.147 Scribe.java --- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 1 Jul 2008 10:04:23 -0000 1.147 +++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 19 Aug 2008 16:04:02 -0000 @@ -949,6 +949,7 @@ this.formatterCommentParser.source = this.scanner.source; this.formatterCommentParser.scanner.lineEnds = this.lineEnds; this.formatterCommentParser.scanner.linePtr = this.maxLines; + this.formatterCommentParser.parseHtmlTags = this.formatter.preferences.comment_format_html; } /** #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java,v retrieving revision 1.22 diff -u -r1.22 FormatterCommentsBugsTest.java --- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 8 Jul 2008 10:44:17 -0000 1.22 +++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 19 Aug 2008 16:04:04 -0000 @@ -1915,4 +1915,40 @@ "}\n" ); } + +/** + * @bug 241345: [formatter] Didn't Format HTML tags is unavailable + * @test Ensure that unset 'Format HTML tags' preference format HTML tags like simple text + * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=241345" + */ +public void testBug241345() throws JavaModelException { + this.preferences.comment_format_html = false; + String source = + "/**\n" + + " *

Should not format HTML paragraph

\n" + + " */\n" + + "public interface Test {\n" + + " /**\n" + + " * \n" + + " * These possibilities include: \n" + + " */\n" + + " int bar();\n" + + "\n" + + "}\n"; + formatSource(source, + "/**\n" + + " *

Should not format HTML paragraph

\n" + + " */\n" + + "public interface Test {\n" + + " /**\n" + + " * \n" + + " * These possibilities include: \n" + + " */\n" + + " int bar();\n" + + "\n" + + "}\n" + ); +} }