Description
It is possible that generic type parameters hide generic type parameters from the enclosing context. This is a source of possible confusion and bugs.
Type
Code Smell
Snippet
public class TypeParameterHidesAnotherType<T> {
public class Inner0<T> { // Noncompliant
//...
}
public class Inner1<S> { // Compliant
//...
}
private <T> T method0() { // Noncompliant
return null;
}
private <S> S method1() { // Compliant
return null;
}
}
Note
Also covered by Eclipse JDT.