Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 151887 Details for
Bug 294618
[formatter] The formatter fails to format a compilation unit with deep nesting of html tags
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v02.txt (text/plain), 5.39 KB, created by
Frederic Fusier
on 2009-11-10 16:34:15 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-11-10 16:34:15 EST
Size:
5.39 KB
patch
obsolete
>### 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" + >+ " * <ol>\n" + >+ " * <li><p> First item\n" + >+ " *\n" + >+ " * <li><p> Second item\n" + >+ " *\n" + >+ " * <li><p> First paragraph of third item\n" + >+ " *\n" + >+ " * <p> Second paragraph of third item\n" + >+ " *\n" + >+ " * <blockquote><table cellpadding=0 cellspacing=0 summary=\"layout\">\n" + >+ " * <tr><td><tt>::255.255.0.d</tt><td></tr>\n" + >+ " * </table></blockquote>\n" + >+ " * </li>\n" + >+ " * </ol>\n" + >+ " */\n" + >+ "public class X01 {\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "package wkps3;\n" + >+ "\n" + >+ "/**\n" + >+ " * The formatter was not able to format the current comment:\n" + >+ " * \n" + >+ " * <ol>\n" + >+ " * <li>\n" + >+ " * <p>\n" + >+ " * First item\n" + >+ " * \n" + >+ " * <li>\n" + >+ " * <p>\n" + >+ " * Second item\n" + >+ " * \n" + >+ " * <li>\n" + >+ " * <p>\n" + >+ " * First paragraph of third item\n" + >+ " * \n" + >+ " * <p>\n" + >+ " * Second paragraph of third item\n" + >+ " * \n" + >+ " * <blockquote>\n" + >+ " * <table cellpadding=0 cellspacing=0 summary=\"layout\">\n" + >+ " * <tr>\n" + >+ " * <td><tt>::255.255.0.d</tt>\n" + >+ " * <td>\n" + >+ " * </tr>\n" + >+ " * </table>\n" + >+ " * </blockquote></li>\n" + >+ " * </ol>\n" + >+ " */\n" + >+ "public class X01 {\n" + >+ "\n" + >+ "}\n" >+ ); >+} >+public void testBug294618b() { >+ String source = >+ "/**\n" + >+ " * Verify deep html tag nesting:\n" + >+ " * \n" + >+ " * <ol>\n" + >+ " * <li><p> First item\n" + >+ " * <li><p> Second item\n" + >+ " * <ul>\n" + >+ " * <li><p> First item of second item\n" + >+ " * <blockquote><table cellpadding=0 cellspacing=0 summary=\"layout\">\n" + >+ " * <tr><td><tt><i><b>::255.255.0.d</b></i></tt></td></tr>\n" + >+ " * </table></blockquote>\n" + >+ " * </li>\n" + >+ " * </ul>\n" + >+ " * </li>\n" + >+ " * </ol>\n" + >+ " */\n" + >+ "public class X02 {\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "/**\n" + >+ " * Verify deep html tag nesting:\n" + >+ " * \n" + >+ " * <ol>\n" + >+ " * <li>\n" + >+ " * <p>\n" + >+ " * First item\n" + >+ " * <li>\n" + >+ " * <p>\n" + >+ " * Second item\n" + >+ " * <ul>\n" + >+ " * <li>\n" + >+ " * <p>\n" + >+ " * First item of second item <blockquote>\n" + >+ " * <table cellpadding=0 cellspacing=0 summary=\"layout\">\n" + >+ " * <tr>\n" + >+ " * <td><tt><i><b>::255.255.0.d</b></i></tt></td>\n" + >+ " * </tr>\n" + >+ " * </table>\n" + >+ " * </blockquote></li>\n" + >+ " * </ul>\n" + >+ " * </li>\n" + >+ " * </ol>\n" + >+ " */\n" + >+ "public class X02 {\n" + >+ "\n" + >+ "}\n" >+ ); >+} >+ >+/** > * @bug 294631: [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=294631"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 294618
: 151887