Wrong "uncheched cast" inspection Permanently deleted user Created September 21, 2006 12:29 if (entity instanceof BasebObj) { ((BasebObj) entity).setDeleted(true); }this code provide "uncheched cast" inspection
Hello Andrew,
AD> if (entity instanceof BasebObj)
AD> {
AD> ((BasebObj) entity).setDeleted(true);
AD> }
AD> this code provide "uncheched cast" inspection
This is not wrong if BasebObj is a generic class. javac reports it as well.
--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"
no BasebObj is not generic class. :(
Class hierarchy Object -> NewBObj -> BasebObj -> .....
and fragment of code:
public boolean restore(Class]]> entityClass, Long id) throws Exception
{
T entity = getEntityManager().find(entityClass, id);
if (entity == null) return false;
if (entity instanceof BasebObj)
{
((BasebObj) entity).setDeleted(null); //inspection here!!!
}
return true;
}
I try to compile code and javac didn't report any warning
Will be fixed in 6.0.1