Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352699 - [1.7][compiler] Improve error range for redundant type parameter warning
Summary: [1.7][compiler] Improve error range for redundant type parameter warning
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 3.7.1   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-21 02:15 EDT by Ayushman Jain CLA
Modified: 2011-08-02 09:09 EDT (History)
2 users (show)

See Also:
satyam.kandula: review+


Attachments
proposed fix + updated tests (11.22 KB, patch)
2011-07-21 02:47 EDT, Ayushman Jain CLA
no flags Details | Diff
proposed fix with slight change (11.23 KB, patch)
2011-07-21 04:00 EDT, Ayushman Jain CLA
no flags Details | Diff

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