src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java
branchJDK-8200758-branch
changeset 57396 3944e4c2f779
parent 57392 46d4b0aa4542
child 57397 89549ecec1c7
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Thu Jun 06 19:31:11 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Thu Jun 06 19:51:17 2019 -0400
@@ -218,16 +218,16 @@
     }
 
     @Override
-    public boolean validate(Map<String, ? super Object> p)
+    public boolean validate(Map<String, ? super Object> params)
             throws UnsupportedPlatformException, ConfigException {
         try {
-            if (p == null) throw new ConfigException(
+            if (params == null) throw new ConfigException(
                     I18N.getString("error.parameters-null"),
                     I18N.getString("error.parameters-null.advice"));
 
             //run basic validation to ensure requirements are met
             //we are not interested in return code, only possible exception
-            APP_BUNDLER.fetchFrom(p).validate(p);
+            APP_BUNDLER.fetchFrom(params).validate(params);
 
             // NOTE: Can we validate that the required tools are available
             // before we start?
@@ -239,14 +239,14 @@
 
 
             // Show warning is license file is missing
-            String licenseFile = LICENSE_FILE.fetchFrom(p);
+            String licenseFile = LICENSE_FILE.fetchFrom(params);
             if (licenseFile == null) {
                 Log.verbose(I18N.getString("message.debs-like-licenses"));
             }
 
             // only one mime type per association, at least one file extention
             List<Map<String, ? super Object>> associations =
-                    FILE_ASSOCIATIONS.fetchFrom(p);
+                    FILE_ASSOCIATIONS.fetchFrom(params);
             if (associations != null) {
                 for (int i = 0; i < associations.size(); i++) {
                     Map<String, ? super Object> assoc = associations.get(i);
@@ -270,7 +270,8 @@
 
             // bundle name has some restrictions
             // the string converter will throw an exception if invalid
-            BUNDLE_NAME.getStringConverter().apply(BUNDLE_NAME.fetchFrom(p), p);
+            BUNDLE_NAME.getStringConverter().apply(
+                    BUNDLE_NAME.fetchFrom(params), params);
 
             return true;
         } catch (RuntimeException re) {
@@ -282,26 +283,26 @@
         }
     }
 
-    private boolean prepareProto(Map<String, ? super Object> p)
+    private boolean prepareProto(Map<String, ? super Object> params)
             throws PackagerException, IOException {
-        File appImage = StandardBundlerParam.getPredefinedAppImage(p);
+        File appImage = StandardBundlerParam.getPredefinedAppImage(params);
         File appDir = null;
 
         // we either have an application image or need to build one
         if (appImage != null) {
-            appDir = new File(APP_IMAGE_ROOT.fetchFrom(p),
-                APP_NAME.fetchFrom(p));
+            appDir = new File(APP_IMAGE_ROOT.fetchFrom(params),
+                APP_NAME.fetchFrom(params));
             // copy everything from appImage dir into appDir/name
             IOUtils.copyRecursive(appImage.toPath(), appDir.toPath());
         } else {
-            appDir = APP_BUNDLER.fetchFrom(p).doBundle(p,
-                    APP_IMAGE_ROOT.fetchFrom(p), true);
+            appDir = APP_BUNDLER.fetchFrom(params).doBundle(params,
+                    APP_IMAGE_ROOT.fetchFrom(params), true);
         }
         return appDir != null;
     }
 
     //@Override
-    public File bundle(Map<String, ? super Object> p,
+    public File bundle(Map<String, ? super Object> params,
             File outdir) throws PackagerException {
         if (!outdir.isDirectory() && !outdir.mkdirs()) {
             throw new PackagerException ("error.cannot-create-output-dir",
@@ -324,15 +325,15 @@
         //             app
         //             runtime
 
-        File imageDir = DEB_IMAGE_DIR.fetchFrom(p);
-        File configDir = CONFIG_DIR.fetchFrom(p);
+        File imageDir = DEB_IMAGE_DIR.fetchFrom(params);
+        File configDir = CONFIG_DIR.fetchFrom(params);
 
         try {
 
             imageDir.mkdirs();
             configDir.mkdirs();
-            if (prepareProto(p) && prepareProjectConfig(p)) {
-                return buildDeb(p, outdir);
+            if (prepareProto(params) && prepareProjectConfig(params)) {
+                return buildDeb(params, outdir);
             }
             return null;
         } catch (IOException ex) {