Community
Participate
Working Groups
Just came to think of this "common beginner" codeing error which would be nice to have an warning/error for. Example (derived from real wildlife code): abstract class Base { ... doSomething(Base b) { SubBase x = (SubBase)b; <= NOT GOOD! Needs a warning/error! <do something with x> } } class SubBase extends Base { } It is totally legit code, but people doing it should be informed about their "ignorance" :)
No clear if this should be covered by a compiler or by some sort of code convention checking tool. Moving to core for commenting (IMO this shouldn't be covered by the compiler).
I am not a big fan either of having this one reported by the compiler (even optionally). May reconsider post 2.1 if more votes are added.
Ok :) (but just curious - what is the difference between this warning and e.g. a warning against x = x; - isn't both just a BAD thing ?)
Closing since support for unnecessary cast/instanceof got added a while ago in 3.0 stream.
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.