Bug 257242 - Review use of java.util.jar.Manifest
Summary: Review use of java.util.jar.Manifest
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M5   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 224439 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-02 13:22 EST by Andrew Niefer CLA
Modified: 2008-12-15 21:35 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Niefer CLA 2008-12-02 13:22:23 EST
See bug 256787.  We discovered a problem in the implementation of java.util.jar.Manifest that can cause it to lose the last attribute in the manifest in rare cases.

We should review our use of this class and consider using ManifestElement from osgi instead.
Comment 1 John Arthorne CLA 2008-12-02 13:35:12 EST
Yes, java.util.jar.Manifest also has awful performance characteristics on signed jars:
 http://wiki.eclipse.org/Performance_Bloopers#JAR_signing_and_verification
Comment 2 DJ Houghton CLA 2008-12-03 08:54:12 EST
A quick search in my workspace doesn't show any use of that class in p2. There are a couple of uses in OSGi but those were described by Tom yesterday in the Equinox call. (required to read all of the manifest) Can this be closed?
Comment 3 John Arthorne CLA 2008-12-03 09:34:22 EST
I found two:

org.eclipse.equinox.internal.frameworkadmin.utils.Utils.basicLoadManifest(File)
org.eclipse.equinox.internal.simpleconfigurator.utils.Utils.basicLoadManifest(File)
Comment 4 Andrew Niefer CLA 2008-12-03 11:17:53 EST
As well, the getOSGiManifest methods in those 2 utility classes use
JarFile#getManifest and JarURLConnection#getManifest, both of which will end up with the same problem.
Comment 5 Andrew Niefer CLA 2008-12-03 11:28:57 EST
The code in simpleconfigurator does not seem to be called at all and should probably just be removed.
Comment 6 John Arthorne CLA 2008-12-03 12:12:15 EST
> The code in simpleconfigurator does not seem to be called at all and should 
> probably just be removed.

Done.
Comment 7 DJ Houghton CLA 2008-12-03 12:53:05 EST
re: comment #3. Awesome. Another case where my Java Search isn't picking up all the matches. *sigh*

Comment 8 DJ Houghton CLA 2008-12-08 15:48:00 EST
*** Bug 224439 has been marked as a duplicate of this bug. ***
Comment 9 Andrew Niefer CLA 2008-12-15 21:35:47 EST
done