Eclipse can be configured to "ignore unavoidable generic type problems" when setting the preferences for the Java Compiler in the "Errors/Warnings" panel.
What are such "unavoidable" generic type problems in Java? Is it safe to ignore these? When do they arise?
From the documentation of the feature:
When enabled, the compiler will issue an error or a warning even when it detects a generic type problem that could not have been avoided by the programmer. As an example, a type may be forced to use raw types in its method signatures and return types because the methods it overrides from a super type are declared to use raw types in the first place.
So, for example:
class Test {
public void method(ArrayList list) {
}
}
class TestSub extends Test {
@Override
public void method(ArrayList list) {
// ^^^^^^^^^
// Complain on use of raw type or not?
System.out.println("Overridden");
}
}
From the Eclipse help page:
When enabled, the compiler will issue an error or a warning even when it detects a generic type problem that could not have been avoided by the programmer. As an example, a type may be forced to use raw types in its method signatures and return types because the methods it overrides from a super type are declared to use raw types in the first place.
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