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 183937 Details for
Bug 328362
[formatter] Format regions does not format as expected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v00.txt (text/plain), 2.17 KB, created by
Frederic Fusier
on 2010-11-26 11:42:21 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2010-11-26 11:42:21 EST
Size:
2.17 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.221 >diff -u -r1.221 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 26 Oct 2010 17:24:15 -0000 1.221 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 23 Nov 2010 17:12:27 -0000 >@@ -418,8 +418,10 @@ > } > } > // Update the replacement string >- if (replacementStart >= length) { >+ if (replacementStart > length || (replacementStart == length && spacesOutsideLength > 0)) { > edit.offset = -1; >+ } else if (spacesOutsideLength == 0 && replacementStart == length) { >+ edit.replacement = ""; //$NON-NLS-1$ > } else { > edit.replacement = edit.replacement.substring(replacementStart); > } >#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.38 >diff -u -r1.38 FormatterBugsTests.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 25 Oct 2010 00:05:11 -0000 1.38 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java 23 Nov 2010 17:12:29 -0000 >@@ -7604,4 +7604,28 @@ > ); > } > >+/** >+ * @bug 328362: [formatter] Format regions does not format as expected >+ * @test Ensure that the given regions are well formatted >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=328362" >+ */ >+public void testBug328362() throws Exception { >+ String source = >+ "package test1;\n" + >+ "\n" + >+ "[# class A {#]\n" + >+ "\n" + >+ "[# int i;#]\n" + >+ "\n" + >+ "}\n"; >+ formatSource(source, >+ "package test1;\n" + >+ "\n" + >+ "class A {\n" + >+ "\n" + >+ " int i;\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 328362
: 183937