The (only) runtime consequence is code failing due to ClassCastException
's, either directly or indirectly1.
The other consequence is that you allow errors that should be detected and corrected at compile time to proceed into test, and maybe production where the costs and consequences may be significantly worse.
While ignoring these warnings is a bad idea, suppressing them incorrectly can be worse.
what do you mean by suppressing them incorrectly ?
I mean adding a @SuppressWarning
annotation for a warning that actually will result in a runtime exception or another (real) problem. Adding a @SuppressWarning
annotation just to make the compiler "shut up" is a dangerous habit.
1 - For instance, if you caught and incorrectly squashed a ClassCastException
!