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 151748 Details for
Bug 294631
[formatter] The formatter takes two passes to format a common sequence of html tags
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 3.06 KB, created by
Frederic Fusier
on 2009-11-09 17:15:27 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-11-09 17:15:27 EST
Size:
3.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.179 >diff -u -r1.179 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 5 Nov 2009 17:41:08 -0000 1.179 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 9 Nov 2009 22:04:13 -0000 >@@ -3536,8 +3536,9 @@ > > // Insert last gap > boolean closingTag = isHtmlBreakTag || (text.htmlIndexes != null && (text.htmlIndexes[max] & JAVADOC_TAGS_ID_MASK) == htmlTagID); >+ boolean isValidHtmlSeparatorTag = max > 0 && isHtmlSeparatorTag && closingTag; > if (previousEnd != -1) { >- if (max > 0 && isHtmlSeparatorTag && closingTag) { >+ if (isValidHtmlSeparatorTag) { > if (linesAfter == 0) linesAfter = 1; > } > if (linesAfter > 0) { >@@ -3563,10 +3564,7 @@ > this.scanner.resetTo(text.sourceEnd+1, this.scannerEndPosition - 1); > > // Return the new lines to insert after >- if (max > 0 && isHtmlSeparatorTag) { >- return 1; >- } >- return 0; >+ return isValidHtmlSeparatorTag ? 1 : 0; > } > > private void printJavadocNewLine(StringBuffer buffer) { >#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.6 >diff -u -r1.6 FormatterBugsTests.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 5 Nov 2009 17:41:02 -0000 1.6 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 9 Nov 2009 22:04:19 -0000 >@@ -1568,4 +1568,42 @@ > DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); > assertEquals("wrong indentation string", org.eclipse.jdt.internal.compiler.util.Util.EMPTY_STRING, codeFormatter.createIndentationString(0)); > } >+ >+/** >+ * @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" >+ */ >+public void testBug294631() { >+ String source = >+ "package wkps3;\n" + >+ "\n" + >+ "/**\n" + >+ " * This comment makes the formatter unstable:\n" + >+ " * \n" + >+ " * <ol>\n" + >+ " * <li><p> first line\n" + >+ " * second line</li>\n" + >+ " * </ol>\n" + >+ " */\n" + >+ "public class X {\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "package wkps3;\n" + >+ "\n" + >+ "/**\n" + >+ " * This comment makes the formatter unstable:\n" + >+ " * \n" + >+ " * <ol>\n" + >+ " * <li>\n" + >+ " * <p>\n" + >+ " * first line second line</li>\n" + >+ " * </ol>\n" + >+ " */\n" + >+ "public class X {\n" + >+ "\n" + >+ "}\n" >+ ); >+} > }
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 294631
: 151748