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 38785 Details for
Bug 135997
[AST] invalid source range with recovered node
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch002.txt (text/plain), 2.93 KB, created by
David Audel
on 2006-04-18 09:22:19 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2006-04-18 09:22:19 EDT
Size:
2.93 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java,v >retrieving revision 1.91 >diff -u -r1.91 ASTConverterTestAST3_2.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 10 Apr 2006 14:02:58 -0000 1.91 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java 18 Apr 2006 13:11:31 -0000 >@@ -7686,4 +7686,53 @@ > workingCopy.discardWorkingCopy(); > } > } >+ /** >+ * http://dev.eclipse.org/bugs/show_bug.cgi?id=135997 >+ */ >+ public void test0645() throws JavaModelException { >+ ICompilationUnit workingCopy = null; >+ try { >+ String contents = >+ "public class X {\n" + >+ " {\n" + >+ " new Object();\n" + >+ " Object.equ;\n" + >+ " }\n" + >+ "}"; >+ workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); >+ ASTNode node = buildAST( >+ contents, >+ workingCopy, >+ false, >+ true); >+ assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); >+ CompilationUnit unit = (CompilationUnit) node; >+ assertProblemsSize( >+ unit, >+ 2, >+ "Object.equ cannot be resolved\n" + >+ "Syntax error, insert \"AssignmentOperator Expression\" to complete Expression"); >+ node = getASTNode(unit, 0, 0); >+ assertEquals("Not a field declaration statement", ASTNode.INITIALIZER, node.getNodeType()); >+ Initializer initializer = (Initializer) node; >+ checkSourceRange( >+ initializer, >+ "{\n" + >+ " new Object();\n" + >+ " Object.equ;\n" + >+ " }", >+ contents); >+ Block block = initializer.getBody(); >+ checkSourceRange( >+ block, >+ "{\n" + >+ " new Object();\n" + >+ " Object.equ;\n" + >+ " }", >+ contents); >+ } finally { >+ if (workingCopy != null) >+ workingCopy.discardWorkingCopy(); >+ } >+ } > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java,v >retrieving revision 1.37 >diff -u -r1.37 RecoveredBlock.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java 29 Mar 2006 02:47:34 -0000 1.37 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java 18 Apr 2006 13:11:34 -0000 >@@ -276,7 +276,11 @@ > } > > if (this.blockDeclaration.sourceEnd == 0) { >- this.blockDeclaration.sourceEnd = lastEnd; >+ if(lastEnd < bodyEndValue) { >+ this.blockDeclaration.sourceEnd = bodyEndValue; >+ } else { >+ this.blockDeclaration.sourceEnd = lastEnd; >+ } > } > > return this.blockDeclaration;
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 135997
:
38261
| 38785