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

Bug 352699

Summary: [1.7][compiler] Improve error range for redundant type parameter warning
Product: [Eclipse Project] JDT Reporter: Ayushman Jain <amj87.iitr>
Component: CoreAssignee: Ayushman Jain <amj87.iitr>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: deepakazad, satyam.kandula
Version: 3.7Flags: satyam.kandula: review+
Target Milestone: 3.7.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed fix + updated tests
none
proposed fix with slight change none

Description Ayushman Jain CLA 2011-07-21 02:15:21 EDT
FUP of bug 340747.

For this case
ArrayList<Map<String, String>> l2=
	new ArrayList<Map<String, String>>();
                      ^^^  
The error range just covers "Map". It is more relevant to cover "ArrayList", since thats the generic type for which the type params have been redundantly specified. The other option is to cover the entire type parameters ie. "Map<String, String>", but that range is difficult to find in JDT/core (will entail a recursive call for nested parameterized types, and also difficult to process by JDT/UI.

So choosing the first option
Comment 1 Deepak Azad CLA 2011-07-21 02:35:40 EDT
Yup, the first option makes it easy for me to fix bug 349336.
Comment 2 Ayushman Jain CLA 2011-07-21 02:47:27 EDT
Created attachment 200056 [details]
proposed fix + updated tests

Changes error range to report the parameterized type for which the redundant type params are specified.
Comment 3 Deepak Azad CLA 2011-07-21 03:04:25 EDT
(In reply to comment #2)
> Created attachment 200056 [details] [diff]
> proposed fix + updated tests
The patch is good from UI perspective.
Comment 4 Ayushman Jain CLA 2011-07-21 04:00:22 EDT
Created attachment 200058 [details]
proposed fix with slight change

A few refactoring changes suggested by Satyam.
Comment 5 Ayushman Jain CLA 2011-07-21 04:00:41 EDT
Satyam, can you please set the review flag? Thanks!
Comment 6 Ayushman Jain CLA 2011-07-21 04:03:33 EDT
Released in BETA_JAVA7 branch
Comment 7 Satyam Kandula CLA 2011-07-21 04:31:15 EDT
changes look good. +1
Comment 8 Satyam Kandula CLA 2011-08-02 09:09:34 EDT
Verified for 3.8M1 using build I20110729-1200