Lex edited on 2007-04-20 15:34:00.0
|
This is very tricky. The two cases should not necessarily have the same behavior. asInstanceOf is often used in cases where there is no way to fix the problem. An example I run into is wrapping a Java library where everything is of type Object; you sometimes have to cast to a type parameter even though it will be an unchecked cast. isInstanceOf warnings I am more sympathetic about; maybe that one should even be an error.
|
Martin edited on 2007-07-19 21:04:03.0
|
isInstanceOf now generates unchecked warnings but asInstanceOf does not.
|