From Jan Lahoda:
Hi,
in JDK7's javac, casts like:
Object o = 42;
int i = (int) o;
are allowed, but these were not allowed in JDK6's javac. This is causing problems in NetBeans, as we are proposing "Add cast" fix and not showing an error for such casts, although the code is not compilable using pre-JDK6 compiler. This is a NetBeans bug:
http://netbeans.org/bugzilla/show_bug.cgi?id=197164
I think that such casts should be source level >= 1.7 only, which I tried to achieve in the attached patch.
Thanks,
Jan