Bug 575009 - Add clean-up to remove generic type arguments of method calls
Summary: Add clean-up to remove generic type arguments of method calls
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.21   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-23 14:09 EDT by Hannes Wellmann CLA
Modified: 2024-05-04 12:09 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Wellmann CLA 2021-07-23 14:09:01 EDT
To remove unnecessary generic type arguments for constructor calls the clean up "Use diamond operator" exists.

An additional clean up action to remove generic type arguments of method calls would also be helpful.

So for example code like 
"""
Map<String, String> map = Collections.<String, String> emptyMap();
Collections.<String, String> emptyMap();
"""

is cleaned up to

"""
Map<String, String> map = Collections.emptyMap();
Collections.emptyMap();
"""
Comment 1 Jeff Johnston CLA 2021-07-23 15:02:50 EDT
A new cleanup is not required.  All that is needed is for the compiler to recognize the scenario as a redundant type parameters situation and to create the problem.  The current redundant type parameters cleanup will fix it once it is recognized.

Moving to core.
Comment 2 Jeff Johnston CLA 2022-05-13 13:08:32 EDT
@tmader Is this something you would be interested in looking at?  Need JDT Core to recognize unnecessary generic type arguments in this case and for 575008 which is quite similar.
Comment 3 Eclipse Genie CLA 2024-05-04 12:09:47 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.