[jdom-interest] JDOM with generics

Mattias Jiderhamn mj-lists at expertsystems.se
Mon May 8 02:19:52 PDT 2006

At 2006-05-06 01:40, Jason Hunter wrote:
>>>>Can code using the Collections API (java.util.List, 
>>>>java.util.Map, ...) and compiled using JDK 1.2 be run under JDK 
>>>>1.5, where the Collections API is implemented with generics...?
>>>Yes.  But new tech is always better at supporting old tech than vice versa.
>>Is there any vice versa in this case? You would only use the 
>>generics enabled JDOM JAR if you in fact are running JDK 1.5 or newer.
>Ever graph the JAR dependency graph of a big project?  It's crazy.  :)
>The issue is what happens when your Java 5 program depends on JDOM 5 
>but also on a package that depends on JDOM 1.0?  Serious 
>question.  You can't assume you can recompile the package because 
>it's not yours. Assuming it was compiled against JDK 1.2, can it 
>understand the JDOM 5 JAR adequately?

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? 

More information about the jdom-interest mailing list