Bug 147877 - source end of array access isn't correct
Summary: source end of array access isn't correct
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.3 M1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 143212
  Show dependency tree
 
Reported: 2006-06-20 10:59 EDT by David Audel CLA
Modified: 2006-08-04 11:24 EDT (History)
0 users

See Also:


Attachments
Proposed patch (7.71 KB, patch)
2006-06-21 10:29 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 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.