>>>>> "Stuart" == Stuart Ballard <[EMAIL PROTECTED]> writes:

Stuart> Does Java draw any distinction at all between, say, java.util.List and
Stuart> java.util.List<Object>?

In the language, yes.  List is the raw type, and List<Object> is a
particular parameterization.  Raw types are kind of a special hack for
backward compatibility, in particular so that you can genericize your
library and let code using it still compile.

Stuart> In other words, will there be any difference in bytecode between:
Stuart> class MyList implements List
Stuart> and
Stuart> class MyList implements List<Object>

I think there will be a difference in the Signature attributes that
are emitted.  Maybe the former won't even have a Signature, I'm not
sure.  I don't think there are other differences.

This particular difference is important due to special handling of
raw types in the compiler.  I haven't checked this but I think:

    List<Object> foo = new MyList();

... is required to emit an 'unchecked' conversion warning for the
former, but not the latter.  (Or maybe it is an error.  My memory for
some of these details is bad.)

Tom


_______________________________________________
Classpath mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to