Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344522 - [1.7] Incorrect source range for ParameterizedType in case of Diamond
Summary: [1.7] Incorrect source range for ParameterizedType in case of Diamond
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Satyam Kandula CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 01:56 EDT by Deepak Azad CLA
Modified: 2011-08-05 02:54 EDT (History)
6 users (show)

See Also:
Olivier_Thomann: review+


Attachments
Proposed fix + regression test (3.28 KB, patch)
2011-05-27 02:58 EDT, Satyam Kandula CLA
satyam.kandula: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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