src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java
branchJDK-8200758-branch
changeset 57125 846d4865b362
parent 57106 ea870b9ce89a
child 57126 8041f62342f0
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java	Tue Jan 29 09:40:14 2019 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java	Wed Jan 30 10:42:19 2019 -0500
@@ -165,8 +165,7 @@
 
             if (index > 0) {
                 result = mainModule.substring(0, index);
-            }
-            else {
+            } else {
                 result = mainModule;
             }
         }
@@ -271,16 +270,6 @@
                 mainJarType == ModFile.ModType.ModularJar) {
             String mainModule = getMainModule(params);
             addModules.add(mainModule);
-
-            // Error if any of the srcfiles are modular jars.
-            Set<String> modularJars =
-                    getResourceFileJarList(params, ModFile.JarType.ModularJar);
-
-            if (!modularJars.isEmpty()) {
-                throw new Exception(MessageFormat.format(I18N.getString(
-                        "error.srcfiles.contain.modules"),
-                        modularJars.toString()));
-            }
         }
         addModules.addAll(getValidModules(
                 modulePath, addModules, limitModules, false));
@@ -351,45 +340,6 @@
         return result;
     }
 
-    private static Set<String> getResourceFileJarList(
-            Map<String, ? super Object> params, ModFile.JarType Query) {
-        Set<String> files = new LinkedHashSet<String>();
-
-        String srcdir = StandardBundlerParam.SOURCE_DIR.fetchFrom(params);
-
-        for (RelativeFileSet appResources :
-                StandardBundlerParam.APP_RESOURCES_LIST.fetchFrom(params)) {
-            for (String resource : appResources.getIncludedFiles()) {
-                if (resource.endsWith(".jar")) {
-                    String filename = srcdir + File.separator + resource;
-
-                    switch (Query) {
-                        case All: {
-                            files.add(filename);
-                            break;
-                        }
-                        case ModularJar: {
-                            ModFile mod = new ModFile(new File(filename));
-                            if (mod.getModType() == ModFile.ModType.ModularJar) {
-                                files.add(filename);
-                            }
-                            break;
-                        }
-                        case UnnamedJar: {
-                            ModFile mod = new ModFile(new File(filename));
-                            if (mod.getModType() == ModFile.ModType.UnnamedJar) {
-                                files.add(filename);
-                            }
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-
-        return files;
-    }
-
     private static Set<String> removeInvalidModules(
             List<Path> modulePath, Set<String> modules) {
         Set<String> result = new LinkedHashSet<String>();