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 73389 Details for
Bug 169934
[formatter] Removes blanks around comments in method declaration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch so people can check the regressions
eclipse-bug-169934-patch-1.patch (text/plain), 4.27 KB, created by
Peter Arrenbrecht
on 2007-07-09 16:40:15 EDT
(
hide
)
Description:
Proposed patch so people can check the regressions
Filename:
MIME Type:
Creator:
Peter Arrenbrecht
Created:
2007-07-09 16:40:15 EDT
Size:
4.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java,v >retrieving revision 1.214 >diff -u -r1.214 FormatterRegressionTests.java >--- src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java 22 Jun 2007 15:43:19 -0000 1.214 >+++ src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java 9 Jul 2007 20:38:22 -0000 >@@ -54,7 +54,7 @@ > private long time; > > static { >-// TESTS_NUMBERS = new int[] { 667 }; >+// TESTS_NUMBERS = new int[] { 668 }; > // TESTS_RANGE = new int[] { 658, -1 }; > } > public static Test suite() { >@@ -9361,4 +9361,23 @@ > JavaCore.setOptions(javaCoreOptions); > } > } >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=169934 >+ public void test668() { >+ final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings(); >+ DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); >+ preferences.comment_format_block_comment = true; >+ >+ preferences.insert_space_after_opening_paren_in_constructor_declaration = true; >+ preferences.insert_space_before_closing_paren_in_constructor_declaration = true; >+ >+ preferences.insert_space_after_opening_paren_in_method_declaration = true; >+ preferences.insert_space_before_closing_paren_in_method_declaration = true; >+ >+ preferences.insert_space_after_opening_paren_in_method_invocation = true; >+ preferences.insert_space_before_closing_paren_in_method_invocation = true; >+ >+ DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); >+ runTest(codeFormatter, "test668", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ >+ } > } >Index: workspace/Formatter/test668/A_in.java >=================================================================== >RCS file: workspace/Formatter/test668/A_in.java >diff -N workspace/Formatter/test668/A_in.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/Formatter/test668/A_in.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+public class FormatTest { >+ >+ public double test( int a, int /**/b/**/ ) { >+ return a + /**/b/**/ * 2; >+ } >+ >+ /**/public/**/ void foo() { >+ } >+ >+ public /**/void/**/ bar() { >+ } >+ >+ /**/public/**/ /**/void/**/ baz() { >+ } >+ >+ /* >+ * A normal block comment. >+ */ >+ >+} >Index: workspace/Formatter/test668/A_out.java >=================================================================== >RCS file: workspace/Formatter/test668/A_out.java >diff -N workspace/Formatter/test668/A_out.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ workspace/Formatter/test668/A_out.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+public class FormatTest { >+ >+ public double test( int a, int /**/b/**/ ) { >+ return a + /**/b/**/ * 2; >+ } >+ >+ /**/public/**/ void foo() { >+ } >+ >+ public /**/void/**/ bar() { >+ } >+ >+ /**/public/**/ /**/void/**/ baz() { >+ } >+ >+ /* >+ * A normal block comment. >+ */ >+ >+} >#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.107 >diff -u -r1.107 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 29 May 2007 15:12:40 -0000 1.107 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 9 Jul 2007 20:38:25 -0000 >@@ -753,6 +753,11 @@ > if (this.pendingSpace) { > this.addInsertEdit(currentTokenStartPosition, " "); //$NON-NLS-1$ > } >+ else if (this.needSpace && currentTokenStartPosition > 0 && this.scanner.source[ currentTokenStartPosition - 1 ] == ' ') { >+ this.addInsertEdit(currentTokenStartPosition, " "); //$NON-NLS-1$ >+ this.needSpace = false; >+ } >+ final boolean neededSpace = this.needSpace; > this.needSpace = false; > this.pendingSpace = false; > >@@ -860,7 +865,7 @@ > this.scanner.currentPosition = nextCharacterStart; > } > this.lastNumberOfNewLines = 0; >- needSpace = false; >+ this.needSpace = neededSpace; > this.scanner.resetTo(currentTokenEndPosition, this.scannerEndPosition - 1); > if (isJavadoc) { > printNewLine();
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 169934
: 73389