You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2005/01/10 11:02:55 UTC
DO NOT REPLY [Bug 33026] New: -
NPE in jar task when zipgroupfileset contains maleformed jar file
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: dev@ant.apache.org
ReportedBy: karl@gan.no
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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org