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 108165 Details for
Bug 239117
AST overlapping source ranges in recovered AST
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug239117_001.txt (text/plain), 3.41 KB, created by
David Audel
on 2008-07-23 03:37:29 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2008-07-23 03:37:29 EDT
Size:
3.41 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java,v >retrieving revision 1.12 >diff -u -r1.12 ASTConverterRecoveryTest.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java 27 Jun 2008 16:02:37 -0000 1.12 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverterRecoveryTest.java 22 Jul 2008 12:11:51 -0000 >@@ -514,7 +514,8 @@ > Statement statement2 = forStatement.getBody(); > assertTrue("Not an empty statement", statement2.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$ > EmptyStatement emptyStatement = (EmptyStatement)statement2; >- checkSourceRange(emptyStatement, "i", source); //$NON-NLS-1$ >+ assertEquals("Wrong start position", fragment.getStartPosition() + fragment.getLength(), emptyStatement.getStartPosition()); >+ assertEquals("Wrong length", 0, emptyStatement.getLength()); > assertTrue("Not flag as RECOVERED", (emptyStatement.getFlags() & ASTNode.RECOVERED) != 0); > } > >@@ -951,4 +952,40 @@ > checkSourceRange(message, "(\"aa\"", source); //$NON-NLS-1$ > assertTrue("Not flag as RECOVERED", (message.getFlags() & ASTNode.RECOVERED) != 0); > } >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=239117 >+ public void test0018() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[0]; >+ >+ ASTResult result = this.buildMarkedAST( >+ "/Converter/src/p/X.java", >+ "package p;\n" + >+ "public class X {\n" + >+ " void m(Object var) {\n" + >+ " if (1==1 && var.equals(1)[*1*][*1*] {\n" + >+ " }\n" + >+ " }\n" + >+ "}"); >+ >+ assertASTResult( >+ "===== AST =====\n" + >+ "package p;\n" + >+ "public class X {\n" + >+ " void m( Object var){\n" + >+ " if (1 == 1 && var.equals(1)) [*1*];[*1*]\n" + >+ " }\n" + >+ "}\n" + >+ "\n" + >+ "===== Details =====\n" + >+ "1:EMPTY_STATEMENT,[77,0],,RECOVERED,[N/A]\n" + >+ "===== Problems =====\n" + >+ "1. ERROR in /Converter/src/p/X.java (at line 4)\n" + >+ " if (1==1 && var.equals(1) {\n" + >+ " ^^^^^^\n" + >+ "The method equals(Object) in the type Object is not applicable for the arguments (int)\n" + >+ "2. ERROR in /Converter/src/p/X.java (at line 4)\n" + >+ " if (1==1 && var.equals(1) {\n" + >+ " ^\n" + >+ "Syntax error, insert \") Statement\" to complete BlockStatements\n", >+ result); >+ } > } >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java,v >retrieving revision 1.389 >diff -u -r1.389 Parser.java >--- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 3 Jul 2008 09:05:25 -0000 1.389 >+++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java 22 Jul 2008 12:11:59 -0000 >@@ -2895,7 +2895,7 @@ > return; > } > } >- pushOnAstStack(new EmptyStatement(this.endStatementPosition, this.endStatementPosition)); >+ pushOnAstStack(new EmptyStatement(this.endPosition + 1, this.endStatementPosition)); > } > } > protected void consumeEmptySwitchBlock() {
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 239117
: 108165