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 172503 Details for
Bug 315577
[formatter] No line break after <br> if followed by {@link when formatting java source file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 3.73 KB, created by
Frederic Fusier
on 2010-06-23 09:50:52 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2010-06-23 09:50:52 EDT
Size:
3.73 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.13 >diff -u -r1.13 FormatJavadocBlock.java >--- formatter/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.java 2 Mar 2010 18:28:48 -0000 1.13 >+++ formatter/org/eclipse/jdt/internal/formatter/FormatJavadocBlock.java 22 Jun 2010 14:37:05 -0000 >@@ -187,7 +187,7 @@ > if (lastText.depth == htmlDepth || // found same html tag level => use it > lastText.htmlNodesPtr == -1) { // no more sub-levels => add one > // Text breakage >- if (lastText.isHtmlTag() && text != null) { >+ if (lastText.isHtmlTag()) { > // Set some lines before if previous was specific html tag > // The added text is concerned if the parent has no child yet or is top level and closing html tag > boolean setLinesBefore = lastText.separatorsPtr == -1 || (ptr == 0 && lastText.isClosingHtmlTag()); >@@ -202,19 +202,19 @@ > if (setLinesBefore) { > switch (lastText.getHtmlTagID()) { > case JAVADOC_CODE_TAGS_ID: >- if (text.linesBefore < 2) { >- text.linesBefore = 2; >+ if (node.linesBefore < 2) { >+ node.linesBefore = 2; > } > break; > case JAVADOC_SEPARATOR_TAGS_ID: > case JAVADOC_SINGLE_BREAK_TAG_ID: >- if (text.linesBefore < 1) { >- text.linesBefore = 1; >+ if (node.linesBefore < 1) { >+ node.linesBefore = 1; > } > } > } > // If adding an html tag on same html tag, then close previous one and leave >- if (text.isHtmlTag() && !text.isClosingHtmlTag() && text.getHtmlTagIndex() == lastText.getHtmlTagIndex() && !lastText.isClosingHtmlTag()) { >+ if (text != null && text.isHtmlTag() && !text.isClosingHtmlTag() && text.getHtmlTagIndex() == lastText.getHtmlTagIndex() && !lastText.isClosingHtmlTag()) { > lastText.closeTag(); > return textHierarchy; > } >#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.67 >diff -u -r1.67 FormatterCommentsBugsTest.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 22 Jun 2010 14:20:59 -0000 1.67 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 22 Jun 2010 14:37:08 -0000 >@@ -6798,6 +6798,29 @@ > } > > /** >+ * @bug 315577: [formatter] NullPointerException (always) on inserting a custom template proposal into java code when "Use code formatter" is on >+ * @test Ensure that no NPE occurs when inserting the custom template >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=315577" >+ */ >+public void testBug315577() throws JavaModelException { >+ String source = >+ "public class C {\n" + >+ "\n" + >+ " /**\n" + >+ " * aaaa aaa aaa.<br>\n" + >+ " * {@link C}: aaaa.<br>\n" + >+ " * {@link C}: aaaa.<br>\n" + >+ " * aaa {@link C}: aaaa.<br>\n" + >+ " * {@link C}: aaaa<br>\n" + >+ " * {@link C}: aaaa.<br>\n" + >+ " */\n" + >+ " public C() {\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source); >+} >+ >+/** > * @bug 315732: [formatter] NullPointerException (always) on inserting a custom template proposal into java code when "Use code formatter" is on > * @test Ensure that no NPE occurs when inserting the custom template > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=315732"
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 315577
: 172503