Inspectopedia Help

Type parameter hides visible type

Reports type parameters that have the same names as the visible types in the current scope. Such parameter names may be confusing.

Example:

abstract class MyList<T> extends AbstractList<T> { private List<T> elements; // type parameter 'T' hides type parameter 'T' public <T> T[] toArray(T[] array) { return elements.toArray(array); } }

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Java, 241.16690

Last modified: 29 April 2024