]> source.dussan.org Git - vaadin-framework.git/commitdiff
Corrections to support for multiple source paths in widgetset builder
authorHenri Sara <henri.sara@itmill.com>
Tue, 27 Oct 2009 15:08:16 +0000 (15:08 +0000)
committerHenri Sara <henri.sara@itmill.com>
Tue, 27 Oct 2009 15:08:16 +0000 (15:08 +0000)
svn changeset:9412/svn branch:6.2

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

index ff8786a6b57cb61c6f1d27aa8fbbb25e67464d45..6a458608038e3e9af23f35b33f8df960e7c8cb52 100644 (file)
@@ -98,7 +98,21 @@ public class ClassPathExplorer {
                             files[i].length() - 8);
                     classname = classpathLocations.get(location) + "."
                             + classname;
-                    widgetsets.put(classname, location);
+                    if (!widgetsets.containsKey(classname)) {
+                        String packageName = classpathLocations.get(location);
+                        String packagePath = packageName.replaceAll("\\.", "/");
+                        String basePath = location.getFile().replaceAll(
+                                "/" + packagePath + "$", "");
+                        try {
+                            URL url = new URL(location.getProtocol(), location
+                                    .getHost(), location.getPort(), basePath);
+                            widgetsets.put(classname, url);
+                        } catch (MalformedURLException e) {
+                            // should never happen as based on an existing URL,
+                            // only changing end of file name/path part
+                            e.printStackTrace();
+                        }
+                    }
                 }
             }
         } else {