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 11564 Details for
Bug 65562
Java AST creation failure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to apply on HEAD
patch_for_65562.txt (text/plain), 3.34 KB, created by
Olivier Thomann
on 2004-06-03 15:56:10 EDT
(
hide
)
Description:
Patch to apply on HEAD
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2004-06-03 15:56:10 EDT
Size:
3.34 KB
patch
obsolete
>Index: dom/org/eclipse/jdt/core/dom/ASTConverter.java >=================================================================== >RCS file: /data/cvs/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java,v >retrieving revision 1.152 >diff -u -r1.152 ASTConverter.java >--- dom/org/eclipse/jdt/core/dom/ASTConverter.java 24 May 2004 15:03:20 -0000 1.152 >+++ dom/org/eclipse/jdt/core/dom/ASTConverter.java 3 Jun 2004 19:54:51 -0000 >@@ -928,7 +928,7 @@ > } > parenthesizedExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); > adjustSourcePositionsForParent(expression); >- removeExtraBlanks(expression); >+ trimWhiteSpacesAndComments(expression); > // decrement the number of parenthesis > int numberOfParenthesis = (expression.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) >> org.eclipse.jdt.internal.compiler.ast.ASTNode.ParenthesizedSHIFT; > expression.bits &= ~org.eclipse.jdt.internal.compiler.ast.ASTNode.ParenthesizedMASK; >@@ -1263,7 +1263,7 @@ > CastExpression castExpression = this.ast.newCastExpression(); > castExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); > org.eclipse.jdt.internal.compiler.ast.Expression type = expression.type; >- removeExtraBlanks(type); >+ trimWhiteSpacesAndComments(type); > if (type instanceof org.eclipse.jdt.internal.compiler.ast.TypeReference ) { > castExpression.setType(convertType((org.eclipse.jdt.internal.compiler.ast.TypeReference)type)); > } else if (type instanceof org.eclipse.jdt.internal.compiler.ast.NameReference) { >@@ -3205,9 +3205,9 @@ > } > > /** >- * Remove whitespaces before and after the expression. >+ * Remove whitespaces and comments before and after the expression. > */ >- private void removeExtraBlanks(org.eclipse.jdt.internal.compiler.ast.Expression expression) { >+ private void trimWhiteSpacesAndComments(org.eclipse.jdt.internal.compiler.ast.Expression expression) { > int start = expression.sourceStart; > int end = expression.sourceEnd; > int token; >@@ -3221,11 +3221,17 @@ > while (true) { > token = removeBlankScanner.getNextToken(); > switch (token) { >+ case TerminalTokens.TokenNameCOMMENT_JAVADOC : >+ case TerminalTokens.TokenNameCOMMENT_LINE : >+ case TerminalTokens.TokenNameCOMMENT_BLOCK : >+ if (first) { >+ trimLeftPosition = removeBlankScanner.currentPosition; >+ } >+ break; > case TerminalTokens.TokenNameWHITESPACE : > if (first) { > trimLeftPosition = removeBlankScanner.currentPosition; > } >- trimRightPosition = removeBlankScanner.startPosition - 1; > break; > case TerminalTokens.TokenNameEOF : > expression.sourceStart = trimLeftPosition; >@@ -3233,12 +3239,13 @@ > return; > default : > /* >- * if we find something else than a whitespace, then we reset the trimRigthPosition >- * to the expression source end. >+ * if we find something else than a whitespace or a comment, >+ * then we reset the trimRigthPosition to the expression >+ * source end. > */ >- trimRightPosition = expression.sourceEnd; >+ trimRightPosition = removeBlankScanner.currentPosition - 1; >+ first = false; > } >- first = false; > } > } catch (InvalidInputException e){ > // ignore
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 65562
: 11564 |
11565