Bug 239117

Summary: AST overlapping source ranges in recovered AST
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann, philippe_mulet
Version: 3.4   
Target Milestone: 3.5 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 152228    
Attachments:
Description Flags
Proposed fix none

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