### 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.22 diff -u -r1.22 FormatterCommentParser.java --- formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java 19 Aug 2008 16:16:39 -0000 1.22 +++ formatter/org/eclipse/jdt/internal/formatter/FormatterCommentParser.java 24 Feb 2009 11:14:42 -0000 @@ -142,13 +142,13 @@ int length = htmlTag == null ? 0 : htmlTag.length; int tagId = 0; if (length > 0) { - for (int i=0, max=JAVADOC_SPECIAL_TAGS.length; i....) static final int JAVADOC_CLOSED_TAG = 0x10000; - static final int JAVADOC_SPECIAL_TAGS_ID = 0x20000; } #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.34 diff -u -r1.34 FormatterCommentsBugsTest.java --- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 14 Jan 2009 10:48:43 -0000 1.34 +++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 24 Feb 2009 11:14:43 -0000 @@ -3229,6 +3229,102 @@ } /** + * @bug 260011: [formatter] Formatting of html in javadoc comments doesn't work with style attributes + * @test Ensure that the comment formatter understand

html tag with attributes + * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=260011" + */ +public void testBug260011() throws JavaModelException { + String source = + "public class Test {\n" + + " /**\n" + + " * some comment text here\n" + + " *

\n" + + " * some text to be styled a certain way\n" + + " *

\n" + + " */\n" + + " void foo() {}\n" + + "\n" + + "}\n"; + formatSource(source, + "public class Test {\n" + + " /**\n" + + " * some comment text here\n" + + " *

\n" + + " * some text to be styled a certain way\n" + + " *

\n" + + " */\n" + + " void foo() {\n" + + " }\n" + + "\n" + + "}\n" + ); +} +public void testBug260011a() throws JavaModelException { + String source = + "public class Test {\n" + + " /**\n" + + " * some comment text here\n" + + " * \n" + + " * end of comment\n" + + " */\n" + + " void foo() {}\n" + + "\n" + + "}\n"; + formatSource(source, + "public class Test {\n" + + " /**\n" + + " * some comment text here\n" + + " * \n" + + " * end of comment\n" + + " */\n" + + " void foo() {\n" + + " }\n" + + "\n" + + "}\n" + ); +} +public void testBug260011b() throws JavaModelException { + String source = + "public class Test {\n" + + " /**\n" + + " * some comment text here\n" + + " *
\n" + 
+		"     *      some text\n" + 
+		"     *           to be styled\n" + 
+		"     *                 a certain way\n" + 
+		"     *      \n" + 
+		"     * 
\n" + + " * end of comment\n" + + " */\n" + + " void foo() {}\n" + + "\n" + + "}\n"; + formatSource(source, + "public class Test {\n" + + " /**\n" + + " * some comment text here\n" + + " * \n" + + " *
\n" + 
+		"	 *      some text\n" + 
+		"	 *           to be styled\n" + 
+		"	 *                 a certain way\n" + 
+		"	 * \n" + 
+		"	 * 
\n" + + " * \n" + + " * end of comment\n" + + " */\n" + + " void foo() {\n" + + " }\n" + + "\n" + + "}\n" + ); +} + +/** * @bug 260274: [formatter] * character is removed while formatting block comments * @test Ensure that the comment formatter keep '*' characters while formatting block comments * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=260274"