[jdom-interest] 1.1 Collections

Ken Rune Helland kenh at csc.no
Tue Mar 6 02:14:09 PST 2001


At 09:55 AM 3/6/2001 +0000, Walker Joe wrote:

> > 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.

My fault, if the classes actually only exsist in one of the
packages it woud work.

What I wrote is still correct, it just doesent apply :-)


Best Regards
KenR




More information about the jdom-interest mailing list