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 154866 Details for
Bug 298243
[formatter] Removing empty lines between import groups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v01.txt (text/plain), 2.54 KB, created by
Frederic Fusier
on 2009-12-21 05:17:11 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-12-21 05:17:11 EST
Size:
2.54 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.185 >diff -u -r1.185 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 18 Dec 2009 13:52:18 -0000 1.185 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 21 Dec 2009 10:11:07 -0000 >@@ -2263,7 +2263,7 @@ > preserveEmptyLines(lines - 1, whitespacesStartPosition); > } > addDeleteEdit(whitespacesStartPosition, whitespacesEndPosition); >- } else if (lines != 0 && (!this.formatter.preferences.join_wrapped_lines || this.formatter.preferences.number_of_empty_lines_to_preserve != 0)) { >+ } else if (lines != 0 && (!this.formatter.preferences.join_wrapped_lines || this.formatter.preferences.number_of_empty_lines_to_preserve != 0 || this.blank_lines_between_import_groups > 0)) { > addReplaceEdit(whitespacesStartPosition, whitespacesEndPosition, getPreserveEmptyLines(lines-1)); > } else { > addDeleteEdit(whitespacesStartPosition, whitespacesEndPosition); >#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.14 >diff -u -r1.14 FormatterBugsTests.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 18 Dec 2009 13:52:14 -0000 1.14 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 21 Dec 2009 10:11:09 -0000 >@@ -3576,4 +3576,27 @@ > "}\n" > ); > } >+ >+/** >+ * @bug 298243: [formatter] Removing empty lines between import groups >+ * @test Verify that space after the @see tag is not removed while formatting >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=298243" >+ */ >+public void testBug298243() { >+ this.formatterPrefs.number_of_empty_lines_to_preserve = 0; >+ String source = >+ "package test;\n" + >+ "\n" + >+ "import java.util.concurrent.atomic.AtomicInteger;\n" + >+ "\n" + >+ "import org.xml.sax.SAXException;\n" + >+ "\n" + >+ "public class Test {\n" + >+ " public static void main(String[] args) {\n" + >+ " SAXException e;\n" + >+ " AtomicInteger w;\n" + >+ " }\n" + >+ "}\n"; >+ formatSource(source); >+} > }
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 298243
:
154836
|
154837
| 154866