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 229443 Details for
Bug 405038
[formatter] infix expression formatting broken without spaces before/after binary operator
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 fix
patch_405038.txt (text/plain), 1.50 KB, created by
Olivier Thomann
on 2013-04-08 09:52:03 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2013-04-08 09:52:03 EDT
Size:
1.50 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java >index 30a8fce..5eadd9b 100644 >--- a/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java >+++ b/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java >@@ -473,9 +473,20 @@ > this.scribe.printNextToken(operators[i], this.preferences.insert_space_before_binary_operator); > this.scribe.alignFragment(binaryExpressionAlignment, i); > } >- if (operators[i] == TerminalTokens.TokenNameMINUS && isNextToken(TerminalTokens.TokenNameMINUS)) { >- // the next character is a minus (unary operator) >- this.scribe.space(); >+ switch(operators[i]) { >+ case TerminalTokens.TokenNameMINUS : >+ if (isNextToken(TerminalTokens.TokenNameMINUS) >+ || isNextToken(TerminalTokens.TokenNameMINUS_MINUS)) { >+ // the next character is a '-' or '--' (unary operator) >+ this.scribe.space(); >+ } >+ break; >+ case TerminalTokens.TokenNamePLUS : >+ if (isNextToken(TerminalTokens.TokenNamePLUS) >+ || isNextToken(TerminalTokens.TokenNamePLUS_PLUS)) { >+ // the next character is a + or ++ (unary operator) >+ this.scribe.space(); >+ } > } > if (this.preferences.insert_space_after_binary_operator) { > this.scribe.space();
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 405038
: 229443 |
229444