[jdom-interest] JDOM with generics

J. McConnell jdotmc at gmail.com
Mon May 8 07:42:05 PDT 2006

On 5/8/06, Mattias Jiderhamn <mj-lists at expertsystems.se> wrote:
> As stated above, you've got the same issue when using the generics
> enabled core Collection API (java.util.*) and also a package
> depending the Collection API but compiled agains the non generics
> (pre JDK 1.5) version.
> The only real difference I can think of betweet these two scenarios
> is that the Collections API *define* generic classes/interfaces
> (List<E>) while JDOM would "instantiate" the generic classes (List<Element>).
> Does anybody know if this would affect the binary compatibility?

I may be mistaken, but I think that we would be fine here because of
type-erasure.  The "List<Element>" syntax is meaninful only at
compile-time.  At runtime, the JVM treats it as a "List<Object>",
which is exactly what a "List" is treated as.

- J.

More information about the jdom-interest mailing list