Bug 129555 - [dom] The length of a recovered fake SimpleName should be 0
Summary: [dom] The length of a recovered fake SimpleName should be 0
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-27 07:26 EST by David Audel CLA
Modified: 2006-03-28 10:19 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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