Check for JAR files without manifests. (FELIX-2317)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@943227 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java b/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
index c179566..39b6f02 100644
--- a/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
+++ b/framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
@@ -23,6 +23,7 @@
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
+import java.util.HashMap;
import java.util.Map;
import java.util.jar.Manifest;
@@ -103,8 +104,10 @@
{
// Get the embedded resource.
Manifest mf = m_jarFile.getManifest();
+ // Use an empty map if there is no manifest.
+ Map headers = (mf == null) ? new HashMap() : mf.getMainAttributes();
// Create a case insensitive map of manifest attributes.
- return new StringMap(mf.getMainAttributes(), false);
+ return new StringMap(headers, false);
}
public synchronized Content getContent() throws Exception