classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: JDK 1.5 support?


From: David Holmes
Subject: RE: JDK 1.5 support?
Date: Fri, 2 Jul 2004 04:05:14 +1000

Robert Schuster wrote:
> Generics do not break binary compatibility - basically they are 'just'
> syntactical sugar. Its the compiler doing all the hard work - at runtime
> it is not possible to tell anything about a type variable (this might
>  change in a later version). Remember that you can develop with
> "-source 1.4" with Java 1.5 (err 5.0 :P )

That's not quite accurate. Structural reflection information about
generified classes is available through new methods in the reflection API. I
believe this extra information is stored in the class file using the
extended class file format that has been defined for 5.0. However if you use
the "-target cldc1.0" setting I mentioned in another email you can produce
1.4 compatible classes in which all the generic type information is lost. In
both cases the actual type parameters have been replaced by their type
erasures in the bytecode.

What you still can't do with reflection is dynamic queries of an instance's
generic characteristics eg  given List<?> list; which is a list of unknown
generic type, you can't ask "list instanceof List<String>".

I don't think it would be easy for Classpath to try and partially adopt the
5.0 features. The Collections may be one area where it is possible though.
But please lets get to an actual release that supports *one* of the platform
versions completely before you start working on the 5.0 stuff.

David Holmes





reply via email to

[Prev in Thread] Current Thread [Next in Thread]