[jdom-interest] 1.1 Collections

Walker Joe joe.walker at barclaycard.co.uk
Mon Mar 5 05:44:04 PST 2001


I noticed some fancy footwork in the ant build script to fix the imports to
work with JDK 1.1 collections. The section starts:
  <target name="collections" if="coll.present" depends="prepare-src">

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.

Under JDK 1.1 with collection.jar on the classpath, the build would use jdk
1.1 collections, and under JDK 1.2+ without the extra jar, jdk 1.2 version
is used. The Dummy.java simply stops the import com.sun...collection.*; from

I've used it on a project and it worked quite well.



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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Dummy.java
Type: application/octet-stream
Size: 264 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010305/55e74c01/Dummy.obj

More information about the jdom-interest mailing list