tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r808928 - /tuscany/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
Date Fri, 28 Aug 2009 15:55:56 GMT
Author: antelder
Date: Fri Aug 28 15:55:56 2009
New Revision: 808928

URL: http://svn.apache.org/viewvc?rev=808928&view=rev
Log:
Fix NPE when contribution jar doesn't have a manifest

Modified:
    tuscany/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java

Modified: tuscany/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java?rev=808928&r1=808927&r2=808928&view=diff
==============================================================================
--- tuscany/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
(original)
+++ tuscany/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
Fri Aug 28 15:55:56 2009
@@ -37,6 +37,7 @@
 import java.util.Properties;
 import java.util.Set;
 import java.util.jar.JarFile;
+import java.util.jar.Manifest;
 
 public class LauncherMain {
     
@@ -166,8 +167,13 @@
             return false;
         }
         JarFile jar = new JarFile(f);
-        String mfc = jar.getManifest().getMainAttributes().getValue("Main-Class");
-        return mfc != null && mfc.length() > 0;
+        Manifest mf = jar.getManifest();
+        if (mf != null) {
+            String mfc = jar.getManifest().getMainAttributes().getValue("Main-Class");
+            return mfc != null && mfc.length() > 0;
+        } else {
+            return false;
+        }
     }
     /**
      * Gets the jars matching a config classpath property



Mime
View raw message