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 58255 Details for
Bug 172848
[formatter] code formatter produces syntax error (unary operator+ followed by prefix increment operator++)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_172848.txt (text/plain), 2.02 KB, created by
Olivier Thomann
on 2007-02-05 09:45:28 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-02-05 09:45:28 EST
Size:
2.02 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.194 >diff -u -r1.194 CodeFormatterVisitor.java >--- formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java 11 Jan 2007 16:04:34 -0000 1.194 >+++ formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java 5 Feb 2007 14:44:46 -0000 >@@ -5204,7 +5204,8 @@ > * Print the operator > */ > int operator; >- switch((unaryExpression.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT) { >+ int operatorValue = (unaryExpression.bits & ASTNode.OperatorMASK) >> ASTNode.OperatorSHIFT; >+ switch(operatorValue) { > case OperatorIds.PLUS: > operator = TerminalTokens.TokenNamePLUS; > break; >@@ -5222,7 +5223,29 @@ > if (this.preferences.insert_space_after_unary_operator) { > this.scribe.space(); > } >- unaryExpression.expression.traverse(this, scope); >+ Expression expression = unaryExpression.expression; >+ >+ if (expression instanceof PrefixExpression) { >+ PrefixExpression prefixExpression = (PrefixExpression) expression; >+ final int numberOfParensForExpression = (prefixExpression.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; >+ if (numberOfParensForExpression == 0) { >+ switch(operatorValue) { >+ case OperatorIds.PLUS: >+ if (prefixExpression.operator == OperatorIds.PLUS) { >+ this.scribe.space(); >+ } >+ break; >+ case OperatorIds.MINUS: >+ if (prefixExpression.operator == OperatorIds.MINUS) { >+ this.scribe.space(); >+ } >+ break; >+ } >+ } >+ expression.traverse(this, scope); >+ } else { >+ expression.traverse(this, scope); >+ } > > if (numberOfParens > 0) { > manageClosingParenthesizedExpression(unaryExpression, numberOfParens);
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 172848
: 58255 |
58256