Bug 548193 - [quick assist] Infer generics type argument quick assist should use diamond operator if at least Java 7 is used
Summary: [quick assist] Infer generics type argument quick assist should use diamond o...
Status: CLOSED DUPLICATE of bug 506243
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.12   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-12 11:46 EDT by Lars Vogel CLA
Modified: 2019-06-12 12:15 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-06-12 11:46:42 EDT
Example:
----
package test;

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

public class Testing {
	
	public static void main(String[] args) {
		List l = new ArrayList();
		l.add("Hello");
	}
}
----

Relevant code after quickfix:

----
	List<String> l = new ArrayList<String>();
	l.add("Hello");
----


Expected:

----
	List<String> l = new ArrayList<>();
	l.add("Hello");
----

This is especially useful if we set the compiler setting to error for redundant type information.
Comment 1 Dani Megert CLA 2019-06-12 12:15:53 EDT

*** This bug has been marked as a duplicate of bug 506243 ***