Bug 126598 - [DOM][AST] String[] s = {"",,,} leads to wrong positions after conversion
Summary: [DOM][AST] String[] s = {"",,,} leads to wrong positions after conversion
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-06 11:35 EST by Olivier Thomann CLA
Modified: 2006-02-15 09:03 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 Olivier Thomann CLA 2006-02-06 11:35:16 EST
The recovered statement is not properly converted inside the AST converter. The positions are wrong.

package test0629;

public class X {
   	String[] s =  {"",,,};
}

We look for the position of the comma or semi-colon to find where the fragment corresponding to s is ending.
Doing this we don't check the balance of braces.
Comment 1 Olivier Thomann CLA 2006-02-06 11:49:00 EST
Fixed and released in HEAD.
Added regression tests:
org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2.test0629/0630/0631
Comment 2 David Audel CLA 2006-02-15 09:03:05 EST
Verified for 3.2 M5 using build I20060215-0010