|
From: Kevin R. <or...@gm...> - 2005-11-23 15:44:50
|
Hi,
I've effectively finished the bulk of the migration to Java 5. In
particular I mean that I've added generics,
annotations(SuppressWarnings, Override and Deprecated), covariant
return types and an enum.
Overall I'd say generics prove most useful for the hidden internal
structures within MillScript, they are effective useless for any
datatype that might be exposed to the scripter(as everything goes onto
MillScripts object stack - e.g. every map that comes off the stack is
IMap< ?, ? > beyond that you're just guessing).
By far the most annoying aspects of the whole transition come from
Sun's Java 5 java compiler. It doesn't support the @SuppressWarnings
annotation and has quite a selection of bugs in understanding simple
casts, e.g try compiling the following with Sun's javac:
class A< T extends Object > {}
class B extends A< Object > {
void broken( A< ? > x ) {
if ( x instanceof B ); // broken - inconvertible types
}
void ok( A x ) {
if ( x instanceof B ); // ok
}
}
Look at the following bug for an idea of the scale of the problem.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D4916620
Kev.
|