Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 399600

Summary: ASTConverter#retrieveEndOfRightParenthesisPosition fails for certain cases
Product: [Eclipse Project] JDT Reporter: Jay Arthanareeswaran <jarthana>
Component: CoreAssignee: Jay Arthanareeswaran <jarthana>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: srikanth_sankaran
Version: 3.8   
Target Milestone: BETA J8   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch with test none

Description Jay Arthanareeswaran CLA 2013-01-31 05:55:52 EST
From bug 391895, comment #29:

The *existing* method ASTConverter#retrieveEndOfRightParenthesisPosition 
is totally bogus and will fail for a test case like:

public class X {
 	static void foo(@ReadOnly("Blah") int z) { 
 		
 	} 
}

@interface ReadOnly {
	String value() default "Blah";
}

The method must discount balanced parentheses.
Comment 1 Jay Arthanareeswaran CLA 2013-02-01 01:19:45 EST
Created attachment 226437 [details]
Patch with test

The buggy method is causing extra dimensions to be ignored in the following case:

int foo(@Marker(\"Blah\") int z) @Marker [] @Marker [] {
    return null;
}

Will release after running the tests.
Comment 2 Jay Arthanareeswaran CLA 2013-02-01 01:49:20 EST
Tests are green and I have pushed the fix to BETA_JAVA8.

Srikanth, it's a minor fix. If you would like to review it, it's here:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=ea916b0462fec6996e619f84c30f348e2877686a