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

Bug 344522

Summary: [1.7] Incorrect source range for ParameterizedType in case of Diamond
Product: [Eclipse Project] JDT Reporter: Deepak Azad <deepakazad>
Component: CoreAssignee: Satyam Kandula <satyam.kandula>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: amj87.iitr, jarthana, markus.kell.r, Olivier_Thomann, satyam.kandula, srikanth_sankaran
Version: 3.7Flags: Olivier_Thomann: review+
Target Milestone: 3.7.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix + regression test satyam.kandula: review?

Description Deepak Azad CLA 2011-05-03 01:56:43 EDT
-------------------------------------------------------------
package p;

import java.util.ArrayList;
import java.util.List;

class Diamond {
	void foo() {
		List<String> a= new ArrayList<>();
	}	
}
-------------------------------------------------------------

The ParameterizedType node for 'ArrayList<>' has source range as [123,10], the correct range should be [123,11].

This works correctly for 'ArrayList<String>', i.e. when the type parameter is available.

(I observed this in AST view plug-in. You will need to get the source of the plug-in from BETA_JAVA7 branch from the cvs location mentioned in http://www.eclipse.org/jdt/ui/astview/index.php.)
Comment 1 Satyam Kandula CLA 2011-05-25 04:54:17 EDT
I will take a look at this.
Comment 2 Satyam Kandula CLA 2011-05-27 02:58:57 EDT
Created attachment 196725 [details]
Proposed fix + regression test
Comment 3 Satyam Kandula CLA 2011-05-27 03:00:14 EDT
Olivier, Can you please review the patch?
Comment 4 Olivier Thomann CLA 2011-05-27 15:18:19 EDT
Patch looks good. I added a comment to explain why '<' can be found as a token.
Committed to BETA_JAVA7 branch.
Comment 5 Satyam Kandula CLA 2011-05-30 02:45:42 EDT
Thanks Olivier.
Comment 6 Jay Arthanareeswaran CLA 2011-06-29 07:59:45 EDT
Verified