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 37984 Details for
Bug 129330
strange statement recovery
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Possible fix
patch002.txt (text/plain), 3.42 KB, created by
David Audel
on 2006-04-07 09:30:15 EDT
(
hide
)
Description:
Possible fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-04-07 09:30:15 EDT
Size:
3.42 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/core/dom/ASTConverter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java,v >retrieving revision 1.238 >diff -u -r1.238 ASTConverter.java >--- dom/org/eclipse/jdt/core/dom/ASTConverter.java 29 Mar 2006 02:54:50 -0000 1.238 >+++ dom/org/eclipse/jdt/core/dom/ASTConverter.java 7 Apr 2006 13:14:15 -0000 >@@ -892,7 +892,20 @@ > return assertStatement; > } > >- public Assignment convert(org.eclipse.jdt.internal.compiler.ast.Assignment expression) { >+ public Expression convert(org.eclipse.jdt.internal.compiler.ast.Assignment expression) { >+ if(isRHSRemovable(expression.expression)) { >+ return convert(expression.lhs); >+ } >+ if(expression.expression instanceof org.eclipse.jdt.internal.compiler.ast.SingleNameReference) { >+ // check if only the left hand side of the assignment should be returned. >+ org.eclipse.jdt.internal.compiler.ast.SingleNameReference rhs = >+ (org.eclipse.jdt.internal.compiler.ast.SingleNameReference)expression.expression; >+ if(rhs.token == RecoveryScanner.FAKE_IDENTIFIER && // the rigth hand side must be a fake initializer >+ expression.lhs.sourceEnd == expression.sourceEnd) { // the '=' of th eassigment must be misssing >+ return convert(expression.lhs); >+ } >+ } >+ > Assignment assignment = new Assignment(this.ast); > if (this.resolveBindings) { > recordNodes(assignment, expression); >@@ -2939,7 +2952,8 @@ > name.setSourceRange(fieldDeclaration.sourceStart, fieldDeclaration.sourceEnd - fieldDeclaration.sourceStart + 1); > variableDeclarationFragment.setName(name); > int start = fieldDeclaration.sourceEnd; >- if (fieldDeclaration.initialization != null) { >+ if (fieldDeclaration.initialization != null && >+ !isRHSRemovable(fieldDeclaration.initialization)) { > final Expression expression = convert(fieldDeclaration.initialization); > variableDeclarationFragment.setInitializer(expression); > start = expression.getStartPosition() + expression.getLength(); >@@ -2968,7 +2982,7 @@ > variableDeclarationFragment.setName(name); > int start = localDeclaration.sourceEnd; > org.eclipse.jdt.internal.compiler.ast.Expression initialization = localDeclaration.initialization; >- boolean hasInitialization = initialization != null; >+ boolean hasInitialization = initialization != null && !isRHSRemovable(localDeclaration.initialization); > if (hasInitialization) { > final Expression expression = convert(initialization); > variableDeclarationFragment.setInitializer(expression); >@@ -3530,6 +3544,18 @@ > return false; > } > >+ private boolean isRHSRemovable(org.eclipse.jdt.internal.compiler.ast.Expression rhs) { >+ if(rhs instanceof org.eclipse.jdt.internal.compiler.ast.SingleNameReference) { >+ // check if the right hand side is a fake identifer and can be removed. >+ org.eclipse.jdt.internal.compiler.ast.SingleNameReference singleName = >+ (org.eclipse.jdt.internal.compiler.ast.SingleNameReference)rhs; >+ if(singleName.token == RecoveryScanner.FAKE_IDENTIFIER) { // the rigth hand side must be a fake initializer >+ return true; >+ } >+ } >+ return false; >+ } >+ > private void lookupForScopes() { > if (this.pendingNameScopeResolution != null) { > for (Iterator iterator = this.pendingNameScopeResolution.iterator(); iterator.hasNext(); ) {
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 129330
: 37984 |
37996
|
38003
|
38004