Inspectopedia Help

Explicit type can be replaced with '<>'

Reports new expressions with type arguments that can be replaced a with diamond type <>.

Example:

List<String> list = new ArrayList<String>(); // reports array list type argument

After the quick-fix is applied:

List<String> list = new ArrayList<>();

This inspection only reports if the language level of the project or module is 7 or higher.

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023