### Eclipse Workspace Patch 1.0 #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 26 Feb 2009 15:20:40 -0000 @@ -3229,6 +3229,356 @@ } /** + * @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 testBug260011_01() 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 testBug260011_02() 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" + ); +} +public void testBug260011_03() throws JavaModelException { + String source = + "public class Test {\n" + + "\n" + + " /**\n" + + " * Indent char is a space char but not a line delimiters.\n" + + " * == Character.isWhitespace(ch) && ch != \'\\n\' && ch != \'\\r\'\n" + + " */\n" + + " public void foo() {\n" + + " }\n" + + "}\n"; + formatSource(source, + "public class Test {\n" + + "\n" + + " /**\n" + + " * Indent char is a space char but not a line delimiters.\n" + + " * == Character.isWhitespace(ch) && ch != \'\\n\' && ch != \'\\r\'\n" + + " */\n" + + " public void foo() {\n" + + " }\n" + + "}\n" + ); +} +public void testBug260011_04() throws JavaModelException { + String source = + "public class Test {\n" + + "\n" + + " /**\n" + + " * The list of variable declaration fragments (element type: \n" + + " * ). Defaults to an empty list.\n" + + " */\n" + + " int field;\n" + + "}\n"; + formatSource(source, + "public class Test {\n" + + "\n" + + " /**\n" + + " * The list of variable declaration fragments (element type:\n" + + " * ). Defaults to an empty list.\n" + + " */\n" + + " int field;\n" + + "}\n" + ); +} +public void testBug260011_05() throws JavaModelException { + String source = + "public class Test {\n" + + "\n" + + " /**\n" + + " * Compares version strings.\n" + + " * \n" + + " * @return result of comparison, as integer;\n" + + " * <0 if left is less than right \n" + + " * 0 if left is equals to right\n" + + " * >0 if left is greater than right\n" + + " */\n" + + " int foo() {\n" + + " return 0;\n" + + " }\n" + + "}\n"; + formatSource(source, + "public class Test {\n" + + "\n" + + " /**\n" + + " * Compares version strings.\n" + + " * \n" + + " * @return result of comparison, as integer;\n" + + " * <0 if left is less than right \n" + + " * 0 if left is equals to right\n" + + " * >0 if left is greater than right\n" + + " */\n" + + " int foo() {\n" + + " return 0;\n" + + " }\n" + + "}\n" + ); +} +public void testBug260011_06() throws JavaModelException { + String source = + "public interface Test {\n" + + "\n" + + " /**\n" + + " * Returns the length of this array.\n" + + " * \n" + + " * @return the length of this array\n" + + " * @exception DebugException if this method fails. Reasons include: