Bug 239117 - AST overlapping source ranges in recovered AST
Summary: AST overlapping source ranges in recovered AST
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 152228
  Show dependency tree
 
Reported: 2008-07-01 09:48 EDT by Martin Aeschlimann CLA
Modified: 2008-08-06 13:43 EDT (History)
2 users (show)

See Also:


Attachments
Proposed fix (3.41 KB, patch)
2008-07-23 03:37 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2008-07-01 09:48:45 EDT
3.4

Look at the (recovered) AST of the following code:

package xy;
public class Try {
    void m(Object var) {
        if (1==1 && var.equals(1) {

        }
    }
}



There's a recovered if statement
 - expression is
   '1==1 && var.equals(1)'
 - then statement is
   ')'

The then statement must not overlap with the expression.
Comment 1 David Audel CLA 2008-07-23 03:37:29 EDT
Created attachment 108165 [details]
Proposed fix

This fix change the start position and the length of the recovered empty statement.
The start position must be one character after the previous real token ')' and the length must be 0.
Comment 2 David Audel CLA 2008-07-23 03:39:27 EDT
Released for 3.5M1.

Test added 
  ASTConverterRecoveryTest#test0018()
Comment 3 Olivier Thomann CLA 2008-08-06 13:43:04 EDT
Verified for 3.5M1 using I20080805-1307