In TC 7, 6, 5.5 build scripts in several places we use <jar index="true"/>, which creates META-INF/INDEX.LIST file in the JAR. I should say that a) The JAR Index feature is designed to speed up location and download of other *.jar files. It is not intended to be used on a single file. See specification [1], blog article that describes main problems [2], ANT documentation on JAR task and especially the nested "indexjars" element as described there [3]. One should use <indexjars> element inside the <jar> task to exploit this feature properly. b) It does not speed up processing of a single JAR. First, a JAR file already has an index, "Central Directory" - see picture in Wikipedia article [4], or official specification from PKWARE [5]. AFAIK, in Sun JRE this central directory is always read and loaded into memory before any random-access query on the file is performed, such as ZipFile#getEntry(String). Second, an URLClassLoader has to consider JARs mentioned in the Index file. It incurs some overhead, though I have not measured how much it is. c) Using Index file can conflict with "Class-Path" entry of the manifest. See [2] for explanation. Also the text of the index file starts with the name of the current JAR file. I suppose that it can have some consequences if the file is renamed. Based on the above, we have to use index="false" on all our <jar> tasks. Links: [1] JAR Index specification - JDK 1.5 http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Index [2] To Use or not to Use Jar Index - A blog article http://javahowto.blogspot.com/2006/08/to-use-or-not-to-use-jar-index.html [3] Jar Task - Apache ANT Documentation http://ant.apache.org/manual/CoreTasks/jar.html [4] ZIP (file format) - Wikipedia http://en.wikipedia.org/wiki/ZIP_%28file_format%29#Technical_information [5] ZIP APPNOTE - PKWARE http://www.pkware.com/support/zip-application-note
Created attachment 25381 [details] 2010-04-30_tc6_bug49236.patch Fixed in trunk in r939612. I am attaching patch for TC6.
Created attachment 25382 [details] 2010-04-30_tc55_bug49236.patch Patch for TC 5.5.
Fixed in trunk, proposed for 6.0 and 5.5
Fixed in 6.0, 5.5, will be in 6.0.27, 5.5.30.