[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Japitools 1.5 support tough design issue
From: |
Tom Tromey |
Subject: |
Re: Japitools 1.5 support tough design issue |
Date: |
07 Sep 2005 10:59:24 -0600 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>>>>> "Stuart" == Stuart Ballard <address@hidden> 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