Android Studio doesn't show a compiler warning when using the raw type in referencing a generic type. Is there a way to enable this feature?
public class GenericClass<T> {
}
public class SpecificClass extends GenericClass {
}
Eclipse usually shows the following warning: GenericClass is a raw type. References to generic type GenericClass <T> should be parameterized.
You can enable the warning but cant force it as compilation error. Same is the case in Eclipse[see tail for the update]. You can refer to JLS which states it compilation warning and not a compilation error.
You can enable the inspection in your android studio. Go to File > Settings > Inspection
and turn on the check as for the "Raw use of parameterized class" setting as shown below may help:
Thanks to Stephan: You can enable this in Eclipse using:
Java Compiler > Errors/Warnings > Generic Types > Usage of a raw type
: and select Error
in the combo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With