Bug 129555

Summary: [dom] The length of a recovered fake SimpleName should be 0
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Audel CLA 2006-02-27 07:26:33 EST
public void foo(int[] a) {
  a[0]
}

The statments recovery create the following ast

public void foo(int[] a) {
  a[0] = 'fake SimpleName'
}

The length of the fake SimpleName is 1 and should be 0 because the source doesn't really contain this node.
Comment 1 David Audel CLA 2006-02-27 09:53:36 EST
Fixed and test added
  ASTConverterRecoveryTest#test0013()

In RecoveryScanner#getNextToken()
   this.startPosition = this.currentPosition - 1;
must be replaced by
   this.startPosition = this.currentPosition;
for inserted tokens.
					
					
Comment 2 Olivier Thomann CLA 2006-03-28 10:19:23 EST
Verified using I20060328-0010 for 3.2M6