removed a reported exception for javadoc or sources jar files for not having a manifest

Former-commit-id: bebbf0a2ef45f8d035a8420e036c6ac034a89760
This commit is contained in:
Jeremy Long
2013-05-31 20:41:23 -04:00
parent 02b43a5d66
commit ea9bfec3c9

View File

@@ -219,8 +219,7 @@ public class JarAnalyzer extends AbstractAnalyzer implements Analyzer {
* pom. * pom.
* @return whether or not evidence was added to the dependency * @return whether or not evidence was added to the dependency
*/ */
@edu.umd.cs.findbugs.annotations.SuppressWarnings( @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "OS_OPEN_STREAM",
value = "OS_OPEN_STREAM",
justification = "The reader on line 259 is closed by closing the zipEntry") justification = "The reader on line 259 is closed by closing the zipEntry")
protected boolean analyzePOM(Dependency dependency) throws IOException, AnalysisException { protected boolean analyzePOM(Dependency dependency) throws IOException, AnalysisException {
boolean foundSomething = false; boolean foundSomething = false;
@@ -514,9 +513,15 @@ public class JarAnalyzer extends AbstractAnalyzer implements Analyzer {
final Manifest manifest = jar.getManifest(); final Manifest manifest = jar.getManifest();
if (manifest == null) { if (manifest == null) {
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.SEVERE, //don't log this for javadoc or sources jar files
String.format("Jar file '%s' does not contain a manifest.", if (!dependency.getFileName().toLowerCase().endsWith("-sources.jar")
dependency.getFileName())); && !dependency.getFileName().toLowerCase().endsWith("-javadoc.jar")
&& !dependency.getFileName().toLowerCase().endsWith("-src.jar")
&& !dependency.getFileName().toLowerCase().endsWith("-doc.jar")) {
Logger.getLogger(JarAnalyzer.class.getName()).log(Level.SEVERE,
String.format("Jar file '%s' does not contain a manifest.",
dependency.getFileName()));
}
return false; return false;
} }
final Attributes atts = manifest.getMainAttributes(); final Attributes atts = manifest.getMainAttributes();