### 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.13.2.7 diff -u -r1.13.2.7 FormatterCommentParser.java --- formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java 9 Jul 2008 08:23:23 -0000 1.13.2.7 +++ formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java 20 Aug 2008 08:46:14 -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.143.2.3 diff -u -r1.143.2.3 Scribe.java --- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 3 Jul 2008 09:05:10 -0000 1.143.2.3 +++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 20 Aug 2008 08:46:14 -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.11.2.9 diff -u -r1.11.2.9 FormatterCommentsBugsTest.java --- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 9 Jul 2008 08:23:21 -0000 1.11.2.9 +++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 20 Aug 2008 08:46:17 -0000 @@ -1811,6 +1811,42 @@ } /** + * @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" + ); +} + +/** * @bug 239941: [formatter] Unclosed html tags make the formatter to produce incorrect outputs * @test Ensure that unclosed html tags do not screw up the formatter in following javadoc comments * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=239941"