[jdom-interest] 1.1 Collections

Walker Joe joe.walker at barclaycard.co.uk
Tue Mar 6 01:55:36 PST 2001


> At 10:32 AM 3/5/2001 -0600, GB/DEV - Philip Nelson wrote:
> 
> > > It occurred to me that by adding the attached file to the
> > > project, it would
> > > be possible to add
> > >   import com.sun.java.util.collections.*;
> > > just after each
> > >   import java.util.*;
> > > And then get rid of a lot of ant trickery.
> >
> >It would still mess with my ide though.  I seems I would always have to
> have
> >both jar files loaded in the IDE classpath to compile but the compiler
> >wouldn't be able to tell which one to use.
> >
> >No?
> 
> 
> If you import two classes/interfaces with the same
> name the compiler will complain about ambeguity when
> doing a reference declaration or new statement.
> 
> You woud have to use the complete classname with
> the pacages to distinguisg between them.
> 
No it does work.
You simply decide in your IDE if you are using 1.1 or 1.2.

If you want to use 1.2, then ensure you are compiling against 1.2 base
classes without collections.jar and the import * will catch the Dummy class
I posted. So there are no clashing classes, and the java.util versions will
be used.

If you want to use 1.1 then compile against collections.jar plus the 1.1
classes.zip, and the Dummy class I posted will be ignored, and the
com.sun... versions will be used.

Joe.



Legal Disclaimer:-

Please be aware that messages sent over
the Internet may not be secure and should
not be seen as forming a legally binding
contract unless otherwise stated.



More information about the jdom-interest mailing list