8212537: Create method and class description comments for main functionality JDK-8200758-branch
authorherrick
Fri, 19 Oct 2018 19:29:20 -0400
branchJDK-8200758-branch
changeset 56994 b4aca2dbe2b5
parent 56993 3629eb24e9ac
child 56995 3d5b13207b70
8212537: Create method and class description comments for main functionality Reviewed-by: almatvee
src/jdk.packager/linux/classes/jdk/packager/internal/linux/LinuxAppBundler.java
src/jdk.packager/share/classes/jdk/packager/internal/AbstractBundler.java
src/jdk.packager/share/classes/jdk/packager/internal/AbstractImageBundler.java
src/jdk.packager/share/classes/jdk/packager/internal/Arguments.java
src/jdk.packager/share/classes/jdk/packager/internal/BasicBundlers.java
src/jdk.packager/share/classes/jdk/packager/internal/Bundler.java
src/jdk.packager/share/classes/jdk/packager/internal/BundlerParamInfo.java
src/jdk.packager/share/classes/jdk/packager/internal/Bundlers.java
src/jdk.packager/share/classes/jdk/packager/internal/CLIHelp.java
src/jdk.packager/share/classes/jdk/packager/internal/CommonParams.java
src/jdk.packager/share/classes/jdk/packager/internal/DeployParams.java
src/jdk.packager/share/classes/jdk/packager/internal/EnumeratedBundlerParam.java
src/jdk.packager/share/classes/jdk/packager/internal/IOUtils.java
src/jdk.packager/share/classes/jdk/packager/internal/JPackagerToolProvider.java
src/jdk.packager/share/classes/jdk/packager/internal/JreUtils.java
src/jdk.packager/share/classes/jdk/packager/internal/Log.java
src/jdk.packager/share/classes/jdk/packager/internal/Platform.java
src/jdk.packager/share/classes/jdk/packager/internal/RelativeFileSet.java
src/jdk.packager/share/classes/jdk/packager/internal/SecondaryLauncherArguments.java
src/jdk.packager/share/classes/jdk/packager/internal/StandardBundlerParam.java
src/jdk.packager/share/classes/jdk/packager/internal/ValidOptions.java
src/jdk.packager/share/classes/jdk/packager/internal/bundlers/BundleParams.java
src/jdk.packager/share/classes/jdk/packager/internal/bundlers/Bundler.java
src/jdk.packager/share/classes/jdk/packager/internal/bundlers/BundlerType.java
src/jdk.packager/windows/classes/jdk/packager/internal/windows/WindowsBundlerParam.java
--- a/src/jdk.packager/linux/classes/jdk/packager/internal/linux/LinuxAppBundler.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/linux/classes/jdk/packager/internal/linux/LinuxAppBundler.java	Fri Oct 19 19:29:20 2018 -0400
@@ -29,8 +29,6 @@
 import jdk.packager.internal.BundlerParamInfo;
 import jdk.packager.internal.ConfigException;
 import jdk.packager.internal.IOUtils;
-import jdk.packager.internal.JreUtils;
-import jdk.packager.internal.JreUtils.Rule;
 import jdk.packager.internal.Log;
 import jdk.packager.internal.Platform;
 import jdk.packager.internal.RelativeFileSet;
--- a/src/jdk.packager/share/classes/jdk/packager/internal/AbstractBundler.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/AbstractBundler.java	Fri Oct 19 19:29:20 2018 -0400
@@ -37,6 +37,13 @@
 import java.util.Map;
 import java.util.ResourceBundle;
 
+/**
+ * AbstractBundler
+ *
+ * This is the base class all Bundlers extend from.
+ * It contains methods and parameters common to all Bundlers.
+ * The concrete implementations are in the platform specific Bundlers.
+ */
 public abstract class AbstractBundler implements Bundler {
 
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
--- a/src/jdk.packager/share/classes/jdk/packager/internal/AbstractImageBundler.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/AbstractImageBundler.java	Fri Oct 19 19:29:20 2018 -0400
@@ -34,7 +34,16 @@
 import static jdk.packager.internal.StandardBundlerParam.*;
 
 /**
- * Common utility methods used by app image bundlers.
+ * AbstractImageBundler
+ *
+ * This is the base class for each of the Application Image Bundlers.
+ *
+ * It contains methods and parameters common to all Image Bundlers.
+ *
+ * Application Image Bundlers are created in "create-image" mode,
+ * or as an intermeadiate step in "create-installer" mode.
+ *
+ * The concrete implementations are in the platform specific Bundlers.
  */
 public abstract class AbstractImageBundler extends AbstractBundler {
 
--- a/src/jdk.packager/share/classes/jdk/packager/internal/Arguments.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/Arguments.java	Fri Oct 19 19:29:20 2018 -0400
@@ -24,7 +24,7 @@
  */
 package jdk.packager.internal;
 
-import jdk.packager.internal.bundlers.Bundler;
+import jdk.packager.internal.bundlers.BundlerType;
 import jdk.packager.internal.bundlers.BundleParams;
 
 import java.io.File;
@@ -51,6 +51,18 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+/**
+ * Arguments
+ *
+ * This class encapsulates and processes the command line arguments,
+ * in effect, implementing all the work of jpackager tool.
+ *
+ * The primary entry point, processArguments():
+ * Processes and validates command line arguments, constructing DeployParams.
+ * Validates the DeployParams, and generate the BundleParams.
+ * Generates List of Bundlers from BundleParams valid for this platform.
+ * Executes each Bundler in the list.
+ */
 public class Arguments {
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
             "jdk.packager.internal.resources.Arguments");
@@ -99,7 +111,7 @@
           "(?:(?:([\"'])(?:\\\\\\1|.)*?(?:\\1|$))|(?:\\\\[\"'\\s]|[^\\s]))++");
 
     private DeployParams deployParams = null;
-    private Bundler.BundleType bundleType = null;
+    private BundlerType bundleType = null;
 
     private int pos = 0;
     private List<String> argList = null;
@@ -146,14 +158,14 @@
 
     public enum CLIOptions {
         CREATE_IMAGE(IMAGE_MODE, OptionCategories.MODE, () -> {
-            context().bundleType = Bundler.BundleType.IMAGE;
+            context().bundleType = BundlerType.IMAGE;
             context().deployParams.setTargetFormat("image");
             setOptionValue(IMAGE_MODE, true);
         }),
 
         CREATE_INSTALLER(INSTALLER_MODE, OptionCategories.MODE, () -> {
             setOptionValue(INSTALLER_MODE, true);
-            context().bundleType = Bundler.BundleType.INSTALLER;
+            context().bundleType = BundlerType.INSTALLER;
             String format = "installer";
             if (hasNextArg()) {
                 String arg = popArg();
@@ -169,7 +181,7 @@
 
         CREATE_JRE_INSTALLER(JRE_INSTALLER_MODE, OptionCategories.MODE, () -> {
             setOptionValue(JRE_INSTALLER_MODE, true);
-            context().bundleType = Bundler.BundleType.INSTALLER;
+            context().bundleType = BundlerType.INSTALLER;
             String format = "installer";
             if (hasNextArg()) {
                 String arg = popArg();
@@ -192,7 +204,7 @@
 
         OUTPUT ("output", "o", OptionCategories.PROPERTY, () -> {
             context().output = popArg();
-            context().deployParams.setOutdir(new File(context().output));
+            context().deployParams.setOutput(new File(context().output));
         }),
 
         DESCRIPTION ("description", "d", OptionCategories.PROPERTY),
@@ -499,7 +511,7 @@
         pos = 0;
 
         deployParams = new DeployParams();
-        bundleType = Bundler.BundleType.NONE;
+        bundleType = BundlerType.NONE;
 
         allOptions = new ArrayList<>();
 
@@ -681,7 +693,7 @@
         }
     }
 
-    private void addResources(CommonParams commonParams,
+    private void addResources(DeployParams deployParams,
             String inputdir, List<String> inputfiles) {
 
         if (inputdir == null || inputdir.isEmpty()) {
@@ -710,7 +722,7 @@
                 Log.info("Unable to add resources: " + e.getMessage());
             }
         }
-        fileNames.forEach(file -> commonParams.addResource(baseDir, file));
+        fileNames.forEach(file -> deployParams.addResource(baseDir, file));
         setClasspath(fileNames);
     }
 
--- a/src/jdk.packager/share/classes/jdk/packager/internal/BasicBundlers.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/BasicBundlers.java	Fri Oct 19 19:29:20 2018 -0400
@@ -32,8 +32,10 @@
 import java.util.concurrent.CopyOnWriteArrayList;
 
 /**
+ * BasicBundlers
+ *
  * A basic bundlers collection that loads the default bundlers.
- * Loads the common bundlers common.
+ * Loads the common bundlers.
  * <UL>
  *     <LI>Windows file image</LI>
  *     <LI>Mac .app</LI>
--- a/src/jdk.packager/share/classes/jdk/packager/internal/Bundler.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/Bundler.java	Fri Oct 19 19:29:20 2018 -0400
@@ -29,6 +29,11 @@
 import java.util.Collection;
 import java.util.Map;
 
+/**
+ * Bundler
+ *
+ * The basic interface implemented by all Bundlers.
+ */
 public interface Bundler {
     /**
      * @return User Friendly name of this bundler.
--- a/src/jdk.packager/share/classes/jdk/packager/internal/BundlerParamInfo.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/BundlerParamInfo.java	Fri Oct 19 19:29:20 2018 -0400
@@ -29,6 +29,11 @@
 import java.util.function.BiFunction;
 import java.util.function.Function;
 
+/**
+ * BundlerParamInfo<T>
+ *
+ * A BundlerParamInfo encapsulates an individual bundler parameter of type <T>.
+ */
 public class BundlerParamInfo<T> {
     /**
      * The user friendly name of the parameter
@@ -46,7 +51,7 @@
     String id;
 
     /**
-     * Type of the parameter.  Typically String.class
+     * Type of the parameter.
      */
     Class<T> valueType;
 
--- a/src/jdk.packager/share/classes/jdk/packager/internal/Bundlers.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/Bundlers.java	Fri Oct 19 19:29:20 2018 -0400
@@ -29,6 +29,11 @@
 import java.util.Iterator;
 import java.util.ServiceLoader;
 
+/**
+ * Bundlers
+ *
+ * The interface implemented by BasicBundlers
+ */
 public interface Bundlers {
 
     /**
--- a/src/jdk.packager/share/classes/jdk/packager/internal/CLIHelp.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/CLIHelp.java	Fri Oct 19 19:29:20 2018 -0400
@@ -27,6 +27,11 @@
 
 import java.util.ResourceBundle;
 
+/**
+ * CLIHelp
+ *
+ * Generate and show the command line interface help message(s).
+ */
 public class CLIHelp {
 
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
--- a/src/jdk.packager/share/classes/jdk/packager/internal/CommonParams.java	Fri Oct 19 08:57:13 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.packager.internal;
-
-import java.io.File;
-
-public abstract class CommonParams {
-    File outdir;
-
-    public void setOutdir(File outdir) {
-        this.outdir = outdir;
-    }
-
-    public abstract void addResource(File baseDir, String path);
-
-    public abstract void addResource(File baseDir, File file);
-
-    public abstract void validate() throws PackagerException;
-
-    @Override
-    public String toString() {
-        return "CommonParams{" + "outdir=" + outdir + '}';
-    }
-
-}
--- a/src/jdk.packager/share/classes/jdk/packager/internal/DeployParams.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/DeployParams.java	Fri Oct 19 19:29:20 2018 -0400
@@ -25,8 +25,8 @@
 
 package jdk.packager.internal;
 
-import jdk.packager.internal.bundlers.*;
-import jdk.packager.internal.bundlers.Bundler.BundleType;
+import jdk.packager.internal.bundlers.BundlerType;
+import jdk.packager.internal.bundlers.BundleParams;
 
 import java.io.File;
 import java.nio.file.Files;
@@ -42,7 +42,13 @@
 import java.util.TreeMap;
 import java.util.TreeSet;
 
-public class DeployParams extends CommonParams {
+/**
+ * DeployParams
+ *
+ * This class is generated and used in Arguments.processArguments() as
+ * intermediate step in generating the BundleParams and ultimately the Bundles
+ */
+public class DeployParams {
 
     final List<RelativeFileSet> resources = new ArrayList<>();
 
@@ -76,7 +82,7 @@
 
     boolean jreInstaller = false;
 
-    String outfile;
+    File outdir = null;
 
     String appId = null;
 
@@ -197,10 +203,6 @@
         appId = id;
     }
 
-    public void setOutfile(String outfile) {
-        this.outfile = outfile;
-    }
-
     public void setParams(List<Param> params) {
         this.params = params;
     }
@@ -225,8 +227,12 @@
         jreInstaller = value;
     }
 
-    public File getOutdir() {
-        return this.outdir;
+    public File getOutput() {
+        return outdir;
+    }
+
+    public void setOutput(File output) {
+        outdir = output;
     }
 
     static class Template {
@@ -261,7 +267,6 @@
         return files;
     }
 
-    @Override
     public void addResource(File baseDir, String path) {
         File file = new File(baseDir, path);
         // normalize top level dir
@@ -276,7 +281,6 @@
                 baseDir, new LinkedHashSet<>(expandFileset(file))));
     }
 
-    @Override
     public void addResource(File baseDir, File file) {
         // normalize initial file
         // to strip things like "." in the path
@@ -332,7 +336,6 @@
         }
     }
 
-    @Override
     public void validate() throws PackagerException {
         if (outdir == null) {
             throw new PackagerException("ERR_MissingArgument", "--output");
@@ -395,14 +398,14 @@
         return result;
     }
 
-    BundleType bundleType = BundleType.NONE;
+    BundlerType bundleType = BundlerType.NONE;
     String targetFormat = null; //means any
 
-    public void setBundleType(BundleType type) {
+    public void setBundleType(BundlerType type) {
         bundleType = type;
     }
 
-    public BundleType getBundleType() {
+    public BundlerType getBundleType() {
         return bundleType;
     }
 
@@ -557,4 +560,10 @@
             bundlerArguments.put(param, value);
         }
     }
+
+    @Override
+    public String toString() {
+        return "DeployParams{" + "outdir=" + outdir + '}';
+    }
+
 }
--- a/src/jdk.packager/share/classes/jdk/packager/internal/EnumeratedBundlerParam.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/EnumeratedBundlerParam.java	Fri Oct 19 19:29:20 2018 -0400
@@ -30,8 +30,9 @@
 import java.util.function.Function;
 
 /**
+ * EnumeratedBundlerParams<T>
  *
- * The class contains key-value pairs (elements) where keys are "displayable"
+ * Contains key-value pairs (elements) where keys are "displayable"
  * keys which the IDE can display/choose and values are "identifier" values
  * which can be stored in parameters' map.
  *
--- a/src/jdk.packager/share/classes/jdk/packager/internal/IOUtils.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/IOUtils.java	Fri Oct 19 19:29:20 2018 -0400
@@ -37,6 +37,11 @@
 import java.util.ArrayList;
 import java.util.List;
 
+/**
+ * IOUtils
+ *
+ * A collection of static utility methods.
+ */
 public class IOUtils {
 
     public static void deleteRecursive(File path) throws IOException {
--- a/src/jdk.packager/share/classes/jdk/packager/internal/JPackagerToolProvider.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/JPackagerToolProvider.java	Fri Oct 19 19:29:20 2018 -0400
@@ -28,6 +28,12 @@
 import java.io.PrintWriter;
 import java.util.spi.ToolProvider;
 
+/**
+ * JPackagerToolProvider
+ *
+ * This is the ToolProvider implementation exported
+ * to java.util.spi.ToolProvider and ultimately javax.tools.ToolProvider
+ */
 public class JPackagerToolProvider implements ToolProvider {
 
     public String name() {
--- a/src/jdk.packager/share/classes/jdk/packager/internal/JreUtils.java	Fri Oct 19 08:57:13 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.packager.internal;
-
-import java.io.File;
-import java.nio.file.Files;
-import java.util.HashSet;
-import java.util.Set;
-
-public class JreUtils {
-
-    public static class Rule {
-        String regex;
-        boolean includeRule;
-        Type type;
-        enum Type {SUFFIX, PREFIX, SUBSTR, REGEX}
-
-        private Rule(String regex, boolean includeRule, Type type) {
-            this.regex = regex;
-            this.type = type;
-            this.includeRule = includeRule;
-        }
-
-        boolean match(String str) {
-            if (type == Type.SUFFIX) {
-                return str.endsWith(regex);
-            }
-            if (type == Type.PREFIX) {
-                return str.startsWith(regex);
-            }
-            if (type == Type.SUBSTR) {
-                return str.contains(regex);
-            }
-            return str.matches(regex);
-        }
-
-        boolean treatAsAccept() {return includeRule;}
-
-        public static Rule suffix(String s) {
-            return new Rule(s, true, Type.SUFFIX);
-        }
-        public static Rule suffixNeg(String s) {
-            return new Rule(s, false, Type.SUFFIX);
-        }
-        static Rule prefix(String s) {
-            return new Rule(s, true, Type.PREFIX);
-        }
-        public static Rule prefixNeg(String s) {
-            return new Rule(s, false, Type.PREFIX);
-        }
-        static Rule substr(String s) {
-            return new Rule(s, true, Type.SUBSTR);
-        }
-        public static Rule substrNeg(String s) {
-            return new Rule(s, false, Type.SUBSTR);
-        }
-    }
-
-    public static boolean shouldExclude(File baseDir, File f, Rule ruleset[]) {
-        if (ruleset == null) {
-            return false;
-        }
-
-        String fname = f.getAbsolutePath().toLowerCase().substring(
-                baseDir.getAbsolutePath().length());
-        // first rule match defines the answer
-        for (Rule r: ruleset) {
-            if (r.match(fname)) {
-                return !r.treatAsAccept();
-            }
-        }
-        // default is include
-        return false;
-    }
-
-    public static void walk(File base, File root,
-            Rule ruleset[], Set<File> files) {
-        walk(base, root, ruleset, files, false);
-    }
-
-    public static void walk(File base, File root, Rule ruleset[],
-            Set<File> files, boolean acceptSymlinks) {
-        if (!root.isDirectory()) {
-            if (root.isFile()) {
-                files.add(root);
-            }
-            return;
-        }
-
-        File[] lst = root.listFiles();
-        if (lst != null) {
-            for (File f : lst) {
-                if ((acceptSymlinks || !Files.isSymbolicLink(f.toPath())) &&
-                        !shouldExclude(base, f, ruleset)) {
-                    if (f.isDirectory()) {
-                        walk(base, f, ruleset, files, acceptSymlinks);
-                    } else if (f.isFile()) {
-                        // add to list
-                        files.add(f);
-                    }
-                }
-            }
-        }
-    }
-
-    public static RelativeFileSet extractJreAsRelativeFileSet(String root,
-            JreUtils.Rule[] ruleset) {
-        return extractJreAsRelativeFileSet(root, ruleset, false);
-    }
-
-    public static RelativeFileSet extractJreAsRelativeFileSet(String root,
-            JreUtils.Rule[] ruleset, boolean acceptSymlinks) {
-        if (root.isEmpty()) {
-            return null;
-        }
-
-        File baseDir = new File(root);
-        Set<File> lst = new HashSet<>();
-        walk(baseDir, baseDir, ruleset, lst, acceptSymlinks);
-
-        return new RelativeFileSet(baseDir, lst);
-    }
-
-}
--- a/src/jdk.packager/share/classes/jdk/packager/internal/Log.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/Log.java	Fri Oct 19 19:29:20 2018 -0400
@@ -30,6 +30,11 @@
 import java.io.PrintStream;
 import java.io.PrintWriter;
 
+/**
+ * Log
+ *
+ * General purpose logging mechanism.
+ */
 public class Log {
     public static class Logger {
         private boolean verbose = false;
--- a/src/jdk.packager/share/classes/jdk/packager/internal/Platform.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/Platform.java	Fri Oct 19 19:29:20 2018 -0400
@@ -28,6 +28,8 @@
 import java.util.regex.Pattern;
 
 /**
+ * Platform
+ *
  * Use <code>Platform</code> to detect the operating system
  * that is currently running.
  *
--- a/src/jdk.packager/share/classes/jdk/packager/internal/RelativeFileSet.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/RelativeFileSet.java	Fri Oct 19 19:29:20 2018 -0400
@@ -30,6 +30,11 @@
 import java.util.LinkedHashSet;
 import java.util.Set;
 
+/**
+ * RelativeFileSet
+ *
+ * A class encapsulating a directory and a set of files within it.
+ */
 public class RelativeFileSet {
 
     private String mode;
--- a/src/jdk.packager/share/classes/jdk/packager/internal/SecondaryLauncherArguments.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/SecondaryLauncherArguments.java	Fri Oct 19 19:29:20 2018 -0400
@@ -31,6 +31,36 @@
 import java.io.File;
 import jdk.packager.internal.Arguments.CLIOptions;
 
+/*
+ * SecondaryLauncherArguments
+ *
+ * Processes a secondary launcher properties file to create the Map of
+ * bundle params applicable to the secondary launcher:
+ *
+ * BundlerParams p = (new SecondaryLauncherArguments(file)).getLauncherMap();
+ *
+ * A secondary launcher is another executable program generated by either the
+ * create-image mode or the create-installer mode.
+ * The secondary launcher may be the same program with different configuration,
+ * or a completely different program created from the same files.
+ *
+ * There may be multiple secondary launchers, each created by using the
+ * command line arg "--secondary-launcher <file path>
+ *
+ * The secondary launcher properties file may have any of:
+ *
+ * name (required)
+ * version
+ * module
+ * class
+ * icon
+ * arguments
+ * jvm-args
+ * win-menu
+ * win-shortcut
+ * win-console
+ *
+ */
 public class SecondaryLauncherArguments {
 
     private final String filename;
@@ -68,7 +98,6 @@
         putUnlessNull(bundleParams, Arguments.CLIOptions.VERSION.getId(),
                 getOptionValue(CLIOptions.VERSION));
 
-        // 4 boolean values:
         putUnlessNull(bundleParams, Arguments.CLIOptions.WIN_MENU_HINT.getId(),
                 getOptionValue(CLIOptions.WIN_MENU_HINT));
         putUnlessNull(bundleParams,
@@ -77,6 +106,7 @@
         putUnlessNull(bundleParams,
                 Arguments.CLIOptions.WIN_CONSOLE_HINT.getId(),
                 getOptionValue(CLIOptions.WIN_CONSOLE_HINT));
+
         putUnlessNull(bundleParams, Arguments.CLIOptions.SINGLETON.getId(),
                 getOptionValue(CLIOptions.SINGLETON));
 
--- a/src/jdk.packager/share/classes/jdk/packager/internal/StandardBundlerParam.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/StandardBundlerParam.java	Fri Oct 19 19:29:20 2018 -0400
@@ -57,6 +57,17 @@
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
+/**
+ * StandardBundlerParams
+ *
+ * A parameter to a bundler.
+ *
+ * Also contains static definitions of all of the common bundler parameters.
+ * (additional platform specific and mode specific bundler parameters
+ * are defined in each of the specific bundlers)
+ *
+ * Also contains static methods that operate on maps of parameters.
+ */
 public class StandardBundlerParam<T> extends BundlerParamInfo<T> {
 
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
--- a/src/jdk.packager/share/classes/jdk/packager/internal/ValidOptions.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/ValidOptions.java	Fri Oct 19 19:29:20 2018 -0400
@@ -31,6 +31,17 @@
 import java.util.Set;
 import jdk.packager.internal.Arguments.CLIOptions;
 
+/**
+ * ValidOptions
+ *
+ * Two basic methods for validating command line options.
+ *
+ * initArgs()
+ *      Computes the Map of valid options for each mode on this Platform.
+ *
+ * checkIfSupported(CLIOptions mode, CLIOptions arg)
+ *      Determine if the given arg is valid in the given mode.
+ */
 public class ValidOptions {
 
     private ValidOptions() {};
--- a/src/jdk.packager/share/classes/jdk/packager/internal/bundlers/BundleParams.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/bundlers/BundleParams.java	Fri Oct 19 19:29:20 2018 -0400
@@ -26,7 +26,7 @@
 package jdk.packager.internal.bundlers;
 
 import jdk.packager.internal.*;
-import jdk.packager.internal.bundlers.Bundler.BundleType;
+import jdk.packager.internal.bundlers.BundlerType;
 import jdk.packager.internal.JLinkBundlerHelper;
 
 import java.io.File;
@@ -268,12 +268,12 @@
     }
 
     @SuppressWarnings("deprecation")
-    public BundleType getType() {
-        return fetchParam(BundleType.class, PARAM_TYPE);
+    public BundlerType getType() {
+        return fetchParam(BundlerType.class, PARAM_TYPE);
     }
 
     @SuppressWarnings("deprecation")
-    public void setType(BundleType type) {
+    public void setType(BundlerType type) {
         putUnlessNull(PARAM_TYPE, type);
     }
 
--- a/src/jdk.packager/share/classes/jdk/packager/internal/bundlers/Bundler.java	Fri Oct 19 08:57:13 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.packager.internal.bundlers;
-
-public final class Bundler {
-
-    private Bundler() {}
-
-    /**
-     * Located here for backwards compatibility
-     */
-    public enum BundleType {
-        NONE,
-        IMAGE,    // Generates app image only
-        INSTALLER // Generates installers
-    }
-
-    @Deprecated
-    public static final class Bundle {
-        public BundleType type = BundleType.NONE;
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/bundlers/BundlerType.java	Fri Oct 19 19:29:20 2018 -0400
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.packager.internal.bundlers;
+
+public enum BundlerType {
+    NONE,
+    IMAGE,    // Generates app image only
+    INSTALLER // Generates installers
+}
--- a/src/jdk.packager/windows/classes/jdk/packager/internal/windows/WindowsBundlerParam.java	Fri Oct 19 08:57:13 2018 -0400
+++ b/src/jdk.packager/windows/classes/jdk/packager/internal/windows/WindowsBundlerParam.java	Fri Oct 19 19:29:20 2018 -0400
@@ -26,7 +26,6 @@
 package jdk.packager.internal.windows;
 
 import jdk.packager.internal.BundlerParamInfo;
-import jdk.packager.internal.JreUtils;
 import jdk.packager.internal.StandardBundlerParam;
 import jdk.packager.internal.Arguments;
 import jdk.packager.internal.RelativeFileSet;
@@ -37,8 +36,6 @@
 import java.util.function.BiFunction;
 import java.util.function.Function;
 
-import static jdk.packager.internal.JreUtils.extractJreAsRelativeFileSet;
-
 public class WindowsBundlerParam<T> extends StandardBundlerParam<T> {
 
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
@@ -123,44 +120,6 @@
                     (s, p) -> Boolean.valueOf(s)
             );
 
-    // Subsetting of JRE is restricted.
-    // JRE README defines what is allowed to strip:
-    // http://www.oracle.com/technetwork/java/javase/jre-8-readme-2095710.html
-    public static final BundlerParamInfo<JreUtils.Rule[]> WIN_JRE_RULES =
-            new StandardBundlerParam<>(
-            "",
-            "",
-            ".win.runtime.rules",
-            JreUtils.Rule[].class,
-            params -> new JreUtils.Rule[]{
-                    JreUtils.Rule.prefixNeg("\\bin\\new_plugin"),
-                    JreUtils.Rule.prefixNeg("\\lib\\deploy"),
-                    JreUtils.Rule.suffixNeg(".pdb"),
-                    JreUtils.Rule.suffixNeg(".map"),
-                    JreUtils.Rule.suffixNeg("axbridge.dll"),
-                    JreUtils.Rule.suffixNeg("eula.dll"),
-                    JreUtils.Rule.substrNeg("javacpl"),
-                    JreUtils.Rule.suffixNeg("wsdetect.dll"),
-                    JreUtils.Rule.substrNeg("eployjava1.dll"),
-                    // NP and IE versions
-                    JreUtils.Rule.substrNeg("bin\\jp2"),
-                    JreUtils.Rule.substrNeg("bin\\jpi"),
-                    // Rule.suffixNeg("lib\\ext"),
-                    // need some of jars there for https to work
-                    JreUtils.Rule.suffixNeg("ssv.dll"),
-                    JreUtils.Rule.substrNeg("npjpi"),
-                    JreUtils.Rule.substrNeg("npoji"),
-                    JreUtils.Rule.suffixNeg(".exe"),
-                    // keep core deploy files as JavaFX APIs use them
-                    // Rule.suffixNeg("deploy.dll"),
-                    JreUtils.Rule.suffixNeg("deploy.jar"),
-                    // Rule.suffixNeg("javaws.jar"),
-                    // Rule.suffixNeg("plugin.jar"),
-                    JreUtils.Rule.suffix(".jar")
-            },
-            (s, p) -> null
-    );
-
     public static final BundlerParamInfo<Boolean> INSTALLDIR_CHOOSER =
             new StandardBundlerParam<> (
             I18N.getString("param.installdir-chooser.name"),