### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: formatter/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.java,v retrieving revision 1.8 diff -u -r1.8 FormatJavadocBlock.java --- formatter/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.java 27 Jun 2008 16:04:08 -0000 1.8 +++ formatter/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.java 10 Nov 2009 21:35:39 -0000 @@ -211,14 +211,14 @@ } // If we have a text after another text, keep the same level to append if (lastTextCanHaveChildren || (htmlDepth == 0 && !lastText.isHtmlTag() && text != null && !text.isHtmlTag())) { - if (textHierarchy == null) textHierarchy = new FormatJavadocText[MAX_TAG_HIERARCHY]; + if (textHierarchy == null) textHierarchy = new FormatJavadocText[htmlDepth+1]; textHierarchy[ptr] = lastText; return textHierarchy; } // Last text cannot have children, so return the built hierarchy return textHierarchy; } - if (textHierarchy == null) textHierarchy = new FormatJavadocText[MAX_TAG_HIERARCHY]; + if (textHierarchy == null) textHierarchy = new FormatJavadocText[htmlDepth+1]; textHierarchy[ptr++] = lastText; lastNode = lastText.htmlNodes[lastText.htmlNodesPtr]; } #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java,v retrieving revision 1.7 diff -u -r1.7 FormatterBugsTests.java --- src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 9 Nov 2009 22:06:51 -0000 1.7 +++ src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 10 Nov 2009 21:35:45 -0000 @@ -1644,6 +1644,125 @@ } /** + * @bug 294618: [formatter] The formatter takes two passes to format a common sequence of html tags + * @test Verify that the specific sequence of html tags is well formatted in one pass + * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=294618" + */ +public void testBug294618a() { + String source = + "package wkps3;\n" + + "\n" + + "/**\n" + + " * The formatter was not able to format the current comment:\n" + + " * \n" + + " *
First item\n" + + " *\n" + + " *
Second item\n" + + " *\n" + + " *
First paragraph of third item\n" + + " *\n" + + " *
Second paragraph of third item\n" + + " *\n" + + " *
\n" + + " *\n" + + " *
\n" + + " * ::255.255.0.d
\n" + + " * First item\n" + + " * \n" + + " *
\n" + + " * Second item\n" + + " * \n" + + " *
\n" + + " * First paragraph of third item\n" + + " * \n" + + " *
\n" + + " * Second paragraph of third item\n" + + " * \n" + + " *
\n" + + " *\n" + + " *
\n" + + " *\n" + + " * \n" + + " *::255.255.0.d\n" + + " * \n" + + " *
First item\n" + + " *
Second item\n" + + " *
First item of second item\n" + + " *
\n" + + " *\n" + + " *
\n" + + " * ::255.255.0.d
\n" + + " * First item\n" + + " *
\n" + + " * Second item\n" + + " *
\n" + + " * First item of second item
\n" + + " *\n" + + " *
\n" + + " *\n" + + " * \n" + + " *::255.255.0.d \n" + + " *