Bug 147877

Summary: source end of array access isn't correct
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.3 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 143212    
Attachments:
Description Flags
Proposed patch none

Description David Audel CLA 2006-06-20 10:59:16 EDT
build I20060614-0843 + JDT/core HEAD

public class X {
  void foo() {
    int i = a[0\u005D;
  }
}

During compilation the source end of the array access isn't correct. The source end is at the start of the unicode character instead of the end of the unicode character.
Comment 1 David Audel CLA 2006-06-21 06:35:59 EDT
There is the same bug with array creation:

new String[0\u005D;
Comment 2 David Audel CLA 2006-06-21 10:29:10 EDT
Created attachment 44997 [details]
Proposed patch
Comment 3 David Audel CLA 2006-06-21 10:37:20 EDT
sourceEnd of ArrayAllocationExpression and ArrayReference must be at the end position of [ instead at the start position of ]. Start and end are at the same position unless if the bracket is an unicode. 

Fix released and test added
  ASTConverterTestAST3_2#test648() -> test651()

Released for 3.3 M1.
Comment 4 Frederic Fusier CLA 2006-08-04 11:24:52 EDT
Verified for 3.3 M1 using build I20060804-0010.