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 142504 Details for
Bug 281655
[formatter] "Never join lines" does not work for annotations.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Draft patch
v00.txt (text/plain), 2.91 KB, created by
Frederic Fusier
on 2009-07-24 07:21:59 EDT
(
hide
)
Description:
Draft patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-07-24 07:21:59 EDT
Size:
2.91 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.169 >diff -u -r1.169 Scribe.java >--- formatter/org/eclipse/jdt/internal/formatter/Scribe.java 20 Jul 2009 15:10:59 -0000 1.169 >+++ formatter/org/eclipse/jdt/internal/formatter/Scribe.java 24 Jul 2009 11:19:55 -0000 >@@ -79,6 +79,7 @@ > private String lineSeparator; > public Alignment memberAlignment; > public boolean needSpace = false; >+ boolean inAnnotation = false; > > public int nlsTagCounter; > public int pageWidth; >Index: formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java,v >retrieving revision 1.215 >diff -u -r1.215 CodeFormatterVisitor.java >--- formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java 18 Jun 2009 08:33:50 -0000 1.215 >+++ formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java 24 Jul 2009 11:19:55 -0000 >@@ -4267,6 +4267,7 @@ > MemberValuePair[] memberValuePairs = annotation.memberValuePairs; > if (memberValuePairs != null) { > int length = memberValuePairs.length; >+ /* > for (int i = 0; i < length - 1; i++) { > memberValuePairs[i].traverse(this, scope); > this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_annotation); >@@ -4275,6 +4276,33 @@ > } > } > memberValuePairs[length - 1].traverse(this, scope); >+ */ >+ Alignment annotationAlignment = this.scribe.createAlignment( >+ "annotationMemberValuePairs",//$NON-NLS-1$ >+ this.preferences.alignment_for_expressions_in_array_initializer, >+ length, >+ this.scribe.scanner.currentPosition); >+ this.scribe.enterAlignment(annotationAlignment); >+ boolean ok = false; >+ do { >+ try { >+ for (int i = 0; i < length; i++) { >+ if (i > 0) { >+ this.scribe.printNextToken(TerminalTokens.TokenNameCOMMA, this.preferences.insert_space_before_comma_in_annotation); >+ this.scribe.printTrailingComment(); >+ } >+ this.scribe.alignFragment(annotationAlignment, i); >+ if (i > 0 && this.preferences.insert_space_after_comma_in_annotation) { >+ this.scribe.space(); >+ } >+ memberValuePairs[i].traverse(this, scope); >+ } >+ ok = true; >+ } catch (AlignmentException e) { >+ this.scribe.redoAlignment(e); >+ } >+ } while (!ok); >+ this.scribe.exitAlignment(annotationAlignment, true); > } > this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation); > return false;
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 281655
:
142504