DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33026>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33026

           Summary: NPE in jar task when zipgroupfileset contains maleformed
                    jar file
           Product: Ant
           Version: 1.6.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


A NPE terminates the jar task if a zipgroupfileset is used to add a jar file
that doesn't contain a valid MANIFEST.MF entry.

<jar destfile="bfj.jar" filesetmanifest="merge">
        <zipgroupfileset refid="manyjars.fileset" />
</jar>

Source : ant/src/main/org/apache/tools/ant/taskdefs/Jar.java

private Manifest getManifest(Reader r) {

        Manifest newManifest = null;
        try {
                newManifest = new Manifest(r);
        } catch (ManifestException e) {
                log("Manifest is invalid: " + e.getMessage(), Project.MSG_ERR);
                //throw new BuildException("Invalid Manifest: " + manifestFile, 
e,
getLocation()); // <-- here!
                return null; // <-- and here!
        } catch (IOException e) {
                throw new BuildException("Unable to read manifest file"
                                                                 + " (" + 
e.getMessage() + ")", e);
        }
        return newManifest;
}

The method getManifest(Reader) throws a BuildException if a source jar has a
invalid manifest, this is correct but can be annoying if you want to merge in
the jar file despite the invalid entry. Perhaps an option should decide wheiter
this function should throw an exception or just return null to allow merging of
third party jars with invalid manifests.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to