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 111387 Details for
Bug 237453
[formatter] Save actions fails to remove excess new lines when set to "format edited lines"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 7.94 KB, created by
Frederic Fusier
on 2008-09-01 05:09:00 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2008-09-01 05:09:00 EDT
Size:
7.94 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.150 >diff -u -r1.150 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 29 Aug 2008 13:21:12 -0000 1.150 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 1 Sep 2008 09:06:40 -0000 >@@ -380,7 +380,9 @@ > // Set the replacement string to the number of missing new lines > // As the end of the edit is out of the region, the possible trailing > // indentation should not be added... >- if (linesReplaced > 0) { >+ if (linesReplaced == 0) { >+ edit.replacement = ""; //$NON-NLS-1$ >+ } else { > int linesCount = linesReplaced > linesOutside ? linesReplaced - linesOutside : 0; > if (linesCount == 0) { > edit.replacement = ""; //$NON-NLS-1$ >#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.26 >diff -u -r1.26 FormatterCommentsBugsTest.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 29 Aug 2008 13:21:18 -0000 1.26 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterCommentsBugsTest.java 1 Sep 2008 09:06:42 -0000 >@@ -741,7 +741,7 @@ > "public class E { \n" + > " \n" + > "\n" + >- " void m3() { // this is a bug\n" + >+ " void m3() { // this is a bug\n" + > "\n" + > " }\n" + > " \n" + >@@ -1361,56 +1361,6 @@ > "}\n" > ); > } >-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=237453 >-public void testBug234583_Bug237453a() throws JavaModelException { >- String source = >- "package test1;\n" + >- "\n" + >- "public class E1 {\n" + >- " void foo() {\n" + >- " }\n" + >- " [#\n" + >- " #]\n" + >- " void bar() {\n" + >- " }\n" + >- "}"; >- formatSource(source, >- "package test1;\n" + >- "\n" + >- "public class E1 {\n" + >- " void foo() {\n" + >- " }\n" + >- " \n" + >- " void bar() {\n" + >- " }\n" + >- "}" >- ); >-} >-public void testBug234583_Bug237453b() throws JavaModelException { >- String source = >- "package test1;\n" + >- "\n" + >- "public class E1 {\n" + >- " void foo() {\n" + >- " }\n" + >- " \n" + >- "[# #]\n" + >- " void bar() {\n" + >- " }\n" + >- "}"; >- formatSource(source, >- "package test1;\n" + >- "\n" + >- "public class E1 {\n" + >- " void foo() {\n" + >- " }\n" + >- " \n" + >- " \n" + >- " void bar() {\n" + >- " }\n" + >- "}" >- ); >-} > // duplicate https://bugs.eclipse.org/bugs/show_bug.cgi?id=237592 > public void testBug234583_Bug237592() throws JavaModelException { > String source = >@@ -1445,7 +1395,7 @@ > " void foo() {\n" + > " }\n" + > "\n" + >- " \n" + >+ "\n" + > " \n" + > " \n" + > " \n" + >@@ -1790,6 +1740,233 @@ > } > > /** >+ * @bug 237453: [formatter] Save actions fails to remove excess new lines when set to "format edited lines" >+ * @test Ensure that empty lines/spaces selection is well formatted >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=237453" >+ */ >+public void testBug237453a() throws JavaModelException { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " [#\n" + >+ " #]\n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}" >+ ); >+} >+public void testBug237453b() throws JavaModelException { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ "[# #]\n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ "\n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}" >+ ); >+} >+public void testBug237453c() throws JavaModelException { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ "[# \n" + >+ "#] void bar() {\n" + >+ " }\n" + >+ "}"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}" >+ ); >+} >+public void testBug237453d() throws JavaModelException { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ "[# \n" + >+ " #] void bar() {\n" + >+ " }\n" + >+ "}"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}" >+ ); >+} >+public void testBug237453e() throws JavaModelException { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ "[# \n" + >+ " #]void bar() {\n" + >+ " }\n" + >+ "}"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}" >+ ); >+} >+public void testBug237453f() throws JavaModelException { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " \n" + >+ "[# #] void bar() {\n" + >+ " }\n" + >+ "}"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " \n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}" >+ ); >+} >+public void testBug237453g() throws JavaModelException { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " \n" + >+ "[# #] void bar() {\n" + >+ " }\n" + >+ "}"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " \n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}" >+ ); >+} >+public void testBug237453h() throws JavaModelException { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " \n" + >+ "[# #]void bar() {\n" + >+ " }\n" + >+ "}"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " \n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}" >+ ); >+} >+public void testBug237453i() throws JavaModelException { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " \n" + >+ "[# #]void bar() {\n" + >+ " }\n" + >+ "}"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "public class E1 {\n" + >+ " void foo() {\n" + >+ " }\n" + >+ " \n" + >+ " \n" + >+ " void bar() {\n" + >+ " }\n" + >+ "}" >+ ); >+} >+ >+/** > * @bug 238090: [formatter] Formatter insert blank lines after javadoc if javadoc contains Commons Attributes @@ annotations > * @test Ensure that no unexpected empty new lines are added while formatting a reference > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=238090"
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 237453
:
106837
|
106840
| 111387