]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added null check as all jars do not include a manifest
authorArtur Signell <artur.signell@itmill.com>
Fri, 13 Nov 2009 09:18:49 +0000 (09:18 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 13 Nov 2009 09:18:49 +0000 (09:18 +0000)
svn changeset:9779/svn branch:6.2

src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java

index 269d911ad1368b4c4c3f2d03da3b7dbbf146f682..cdc569cb665d8213e5fd8a3a183c4678b1fe7260 100644 (file)
@@ -41,7 +41,7 @@ import com.vaadin.ui.ClientWidget;
  * appropriate monkey code for gwt directly in annotation processor and get rid
  * of {@link WidgetMapGenerator}. Using annotation processor might be a good
  * idea when dropping Java 1.5 support (integrated to javac in 6).
- *
+ * 
  */
 public class ClassPathExplorer {
     private final static FileFilter DIRECTORIES_ONLY = new FileFilter() {
@@ -75,7 +75,7 @@ public class ClassPathExplorer {
 
     /**
      * Finds available widgetset names.
-     *
+     * 
      * @return
      */
     public static Map<String, URL> getAvailableWidgetSets() {
@@ -133,6 +133,10 @@ public class ClassPathExplorer {
                     JarFile jarFile = conn.getJarFile();
 
                     Manifest manifest = jarFile.getManifest();
+                    if (manifest == null) {
+                        // No manifest so this is not a Vaadin Add-on
+                        return;
+                    }
                     String value = manifest.getMainAttributes().getValue(
                             "Vaadin-Widgetsets");
                     if (value != null) {
@@ -238,7 +242,7 @@ public class ClassPathExplorer {
 
     /**
      * Recursively add subdirectories and jar files to classpathlocations
-     *
+     * 
      * @param name
      * @param file
      * @param locations
@@ -374,12 +378,12 @@ public class ClassPathExplorer {
     /**
      * Find and return the default source directory where to create new
      * widgetsets.
-     *
+     * 
      * Return the first directory (not a JAR file etc.) on the classpath by
      * default.
-     *
+     * 
      * TODO this could be done better...
-     *
+     * 
      * @return URL
      */
     public static URL getDefaultSourceDirectory() {