8213425: Analyze output from Source code scanner and fix where needed.
Reviewed-by: almatvee
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,21 +25,7 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.AbstractImageBundler;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.ConfigException;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.Platform;
-import jdk.jpackage.internal.RelativeFileSet;
-import jdk.jpackage.internal.StandardBundlerParam;
-import jdk.jpackage.internal.Arguments;
-import jdk.jpackage.internal.UnsupportedPlatformException;
-import jdk.jpackage.internal.BundleParams;
-import jdk.jpackage.internal.LinuxAppImageBuilder;
import jdk.jpackage.internal.resources.LinuxResources;
-import jdk.jpackage.internal.JLinkBundlerHelper;
-import jdk.jpackage.internal.AbstractAppImageBuilder;
import java.io.File;
import java.io.IOException;
@@ -126,8 +112,7 @@
}
}
- //used by chained bundlers to reuse validation logic
- boolean doValidate(Map<String, ? super Object> p)
+ private boolean doValidate(Map<String, ? super Object> p)
throws UnsupportedPlatformException, ConfigException {
if (Platform.getPlatform() != Platform.LINUX) {
throw new UnsupportedPlatformException();
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,13 +25,7 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.RelativeFileSet;
-import jdk.jpackage.internal.StandardBundlerParam;
import jdk.jpackage.internal.resources.LinuxResources;
-import jdk.jpackage.internal.AbstractAppImageBuilder;
import java.io.File;
import java.io.FileInputStream;
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,9 +25,6 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.*;
-import jdk.jpackage.internal.Arguments;
-import jdk.jpackage.internal.BundleParams;
import jdk.jpackage.internal.resources.LinuxResources;
import javax.imageio.ImageIO;
@@ -275,7 +272,7 @@
//run basic validation to ensure requirements are met
//we are not interested in return code, only possible exception
- APP_BUNDLER.fetchFrom(p).doValidate(p);
+ APP_BUNDLER.fetchFrom(p).validate(p);
// NOTE: Can we validate that the required tools are available
// before we start?
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,8 +25,6 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.*;
-import jdk.jpackage.internal.Arguments;
import jdk.jpackage.internal.resources.LinuxResources;
import javax.imageio.ImageIO;
@@ -44,8 +42,7 @@
import static jdk.jpackage.internal.StandardBundlerParam.*;
import static jdk.jpackage.internal.LinuxAppBundler.LINUX_INSTALL_DIR;
-import static
- jdk.jpackage.internal.LinuxAppBundler.LINUX_PACKAGE_DEPENDENCIES;
+import static jdk.jpackage.internal.LinuxAppBundler.LINUX_PACKAGE_DEPENDENCIES;
public class LinuxRpmBundler extends AbstractBundler {
@@ -205,7 +202,7 @@
// run basic validation to ensure requirements are met
// we are not interested in return code, only possible exception
- APP_BUNDLER.fetchFrom(p).doValidate(p);
+ APP_BUNDLER.fetchFrom(p).validate(p);
// validate license file, if used, exists in the proper place
if (p.containsKey(LICENSE_FILE.getID())) {
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,19 +25,7 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.AbstractImageBundler;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.ConfigException;
-import jdk.jpackage.internal.EnumeratedBundlerParam;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.Platform;
-import jdk.jpackage.internal.StandardBundlerParam;
-import jdk.jpackage.internal.Arguments;
-import jdk.jpackage.internal.UnsupportedPlatformException;
-import jdk.jpackage.internal.MacAppImageBuilder;
import jdk.jpackage.internal.resources.MacResources;
-import jdk.jpackage.internal.JLinkBundlerHelper;
import java.io.File;
import java.io.IOException;
@@ -304,9 +292,7 @@
}
}
- // to be used by chained bundlers, e.g. by EXE bundler to avoid
- // skipping validation if p.type does not include "image"
- public boolean doValidate(Map<String, ? super Object> p)
+ private boolean doValidate(Map<String, ? super Object> p)
throws UnsupportedPlatformException, ConfigException {
if (Platform.getPlatform() != Platform.MAC) {
throw new UnsupportedPlatformException();
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,15 +25,7 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.Platform;
-import jdk.jpackage.internal.RelativeFileSet;
-import jdk.jpackage.internal.StandardBundlerParam;
-import jdk.jpackage.internal.Arguments;
import jdk.jpackage.internal.resources.MacResources;
-import jdk.jpackage.internal.AbstractAppImageBuilder;
import java.io.BufferedWriter;
import java.io.File;
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,15 +25,6 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.StandardBundlerParam;
-import jdk.jpackage.internal.Arguments;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.ConfigException;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Platform;
-import jdk.jpackage.internal.UnsupportedPlatformException;
-import jdk.jpackage.internal.MacAppImageBuilder;
import jdk.jpackage.internal.resources.MacResources;
import java.io.File;
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,15 +25,7 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.AbstractBundler;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.StandardBundlerParam;
-import jdk.jpackage.internal.Arguments;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.ConfigException;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Platform;
-import jdk.jpackage.internal.UnsupportedPlatformException;
+import jdk.jpackage.internal.resources.MacResources;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -165,7 +157,7 @@
"message.app-image-requires-identifier.advice"));
}
} else {
- APP_BUNDLER.fetchFrom(params).doValidate(params);
+ APP_BUNDLER.fetchFrom(params).validate(params);
}
}
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacCertificate.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacCertificate.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,9 +25,6 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Log;
-
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
@@ -46,21 +43,21 @@
import java.util.List;
import java.util.Locale;
-final public class MacCertificate {
+final class MacCertificate {
private final String certificate;
private final boolean verbose;
- public MacCertificate(String certificate) {
+ MacCertificate(String certificate) {
this.certificate = certificate;
this.verbose = false;
}
- public MacCertificate(String certificate, boolean verbose) {
+ MacCertificate(String certificate, boolean verbose) {
this.certificate = certificate;
this.verbose = verbose;
}
- public boolean isValid() {
+ boolean isValid() {
return verifyCertificate(this.certificate, verbose);
}
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,10 +25,7 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.*;
-import jdk.jpackage.internal.IOUtils;
import jdk.jpackage.internal.resources.MacResources;
-import jdk.jpackage.internal.Arguments;
import java.io.*;
import java.nio.file.Files;
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,17 +25,7 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.StandardBundlerParam;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.ConfigException;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Platform;
-import jdk.jpackage.internal.RelativeFileSet;
-import jdk.jpackage.internal.UnsupportedPlatformException;
import jdk.jpackage.internal.resources.MacResources;
-import jdk.jpackage.internal.MacAppImageBuilder;
-import jdk.jpackage.internal.Arguments;
import java.io.BufferedWriter;
import java.io.File;
@@ -56,10 +46,8 @@
import java.util.ResourceBundle;
import static jdk.jpackage.internal.StandardBundlerParam.*;
-import static
- jdk.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEYCHAIN;
-import static
- jdk.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEY_USER;
+import static jdk.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEYCHAIN;
+import static jdk.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEY_USER;
public class MacPkgBundler extends MacBaseInstallerBundler {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,12 +25,6 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.StandardBundlerParam;
-import jdk.jpackage.internal.JLinkBundlerHelper;
-import jdk.jpackage.internal.ModFile;
-
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ArgAction.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ArgAction.java Mon Dec 10 16:48:25 2018 -0500
@@ -26,6 +26,6 @@
package jdk.jpackage.internal;
@FunctionalInterface
-public interface ArgAction {
- public void execute();
+interface ArgAction {
+ void execute();
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Mon Dec 10 16:48:25 2018 -0500
@@ -24,9 +24,6 @@
*/
package jdk.jpackage.internal;
-import jdk.jpackage.internal.BundlerType;
-import jdk.jpackage.internal.BundleParams;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -156,6 +153,7 @@
initArgumentList(args);
}
+ // CLIOptions is public for DeployParamsTest
public enum CLIOptions {
CREATE_IMAGE(IMAGE_MODE, OptionCategories.MODE, () -> {
context().bundleType = BundlerType.IMAGE;
@@ -429,7 +427,7 @@
this.category = category;
}
- public static void setContext(Arguments context) {
+ static void setContext(Arguments context) {
argContext = context;
}
@@ -445,16 +443,16 @@
return this.id;
}
- public String getIdWithPrefix() {
+ String getIdWithPrefix() {
String prefix = isMode() ? "create-" : "--";
return prefix + this.id;
}
- public String getShortIdWithPrefix() {
+ String getShortIdWithPrefix() {
return this.shortId == null ? null : "-" + this.shortId;
}
- public void execute() {
+ void execute() {
if (action != null) {
action.execute();
} else {
@@ -462,11 +460,11 @@
}
}
- public boolean isMode() {
+ boolean isMode() {
return category == OptionCategories.MODE;
}
- public OptionCategories getCategory() {
+ OptionCategories getCategory() {
return category;
}
@@ -502,7 +500,7 @@
}
}
- public enum OptionCategories {
+ enum OptionCategories {
MODE,
MODULAR,
PROPERTY,
@@ -800,11 +798,11 @@
StandardBundlerParam.CLASSPATH.getID(), classpath);
}
- public static boolean isCLIOption(String arg) {
+ static boolean isCLIOption(String arg) {
return toCLIOption(arg) != null;
}
- public static CLIOptions toCLIOption(String arg) {
+ static CLIOptions toCLIOption(String arg) {
CLIOptions option;
if ((option = argIds.get(arg)) == null) {
option = argShortIds.get(arg);
@@ -928,7 +926,7 @@
return null;
}
- public static boolean isJreInstaller() {
+ static boolean isJreInstaller() {
return jreInstaller;
}
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -74,7 +74,7 @@
* exception may contain advice on how to modify the params map
* to make it valid.
*/
- boolean validate(Map<String, ? super Object> params)
+ public boolean validate(Map<String, ? super Object> params)
throws UnsupportedPlatformException, ConfigException;
/**
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java Mon Dec 10 16:48:25 2018 -0500
@@ -34,7 +34,7 @@
*
* A BundlerParamInfo encapsulates an individual bundler parameter of type <T>.
*/
-public class BundlerParamInfo<T> {
+class BundlerParamInfo<T> {
/**
* The user friendly name of the parameter
*/
@@ -66,60 +66,60 @@
*/
BiFunction<String, Map<String, ? super Object>, T> stringConverter;
- public String getName() {
+ String getName() {
return name;
}
- public void setName(String name) {
+ void setName(String name) {
this.name = name;
}
- public String getDescription() {
+ String getDescription() {
return description;
}
- public void setDescription(String description) {
+ void setDescription(String description) {
this.description = description;
}
- public String getID() {
+ String getID() {
return id;
}
- public Class<T> getValueType() {
+ Class<T> getValueType() {
return valueType;
}
- public void setValueType(Class<T> valueType) {
+ void setValueType(Class<T> valueType) {
this.valueType = valueType;
}
- public Function<Map<String, ? super Object>, T> getDefaultValueFunction() {
+ Function<Map<String, ? super Object>, T> getDefaultValueFunction() {
return defaultValueFunction;
}
- public void setDefaultValueFunction(
+ void setDefaultValueFunction(
Function<Map<String, ? super Object>, T> defaultValueFunction) {
this.defaultValueFunction = defaultValueFunction;
}
- public BiFunction<String, Map<String, ? super Object>,T>
+ BiFunction<String, Map<String, ? super Object>,T>
getStringConverter() {
return stringConverter;
}
- public void setStringConverter(BiFunction<String,
+ void setStringConverter(BiFunction<String,
Map<String, ? super Object>, T> stringConverter) {
this.stringConverter = stringConverter;
}
@SuppressWarnings("unchecked")
- public final T fetchFrom(Map<String, ? super Object> params) {
+ final T fetchFrom(Map<String, ? super Object> params) {
return fetchFrom(params, true);
}
@SuppressWarnings("unchecked")
- public final T fetchFrom(Map<String, ? super Object> params,
+ final T fetchFrom(Map<String, ? super Object> params,
boolean invokeDefault) {
Object o = params.get(getID());
if (o instanceof String && getStringConverter() != null) {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerType.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerType.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,7 +25,7 @@
package jdk.jpackage.internal;
-public enum BundlerType {
+enum BundlerType {
NONE,
IMAGE, // Generates app image only
INSTALLER // Generates installers
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,9 +25,6 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.BundlerType;
-import jdk.jpackage.internal.BundleParams;
-
import java.io.File;
import java.nio.file.Files;
import java.util.ArrayList;
@@ -97,63 +94,63 @@
// raw arguments to the bundler
Map<String, ? super Object> bundlerArguments = new LinkedHashMap<>();
- public void setCategory(String category) {
+ void setCategory(String category) {
this.category = category;
}
- public void setLicenseType(String licenseType) {
+ void setLicenseType(String licenseType) {
this.licenseType = licenseType;
}
- public void setCopyright(String copyright) {
+ void setCopyright(String copyright) {
this.copyright = copyright;
}
- public void setVersion(String version) {
+ void setVersion(String version) {
this.version = version;
}
- public void setSystemWide(Boolean systemWide) {
+ void setSystemWide(Boolean systemWide) {
this.systemWide = systemWide;
}
- public void setServiceHint(Boolean serviceHint) {
+ void setServiceHint(Boolean serviceHint) {
this.serviceHint = serviceHint;
}
- public void setInstalldirChooser(Boolean installdirChooser) {
+ void setInstalldirChooser(Boolean installdirChooser) {
this.installdirChooser = installdirChooser;
}
- public void setSingleton(Boolean singleton) {
+ void setSingleton(Boolean singleton) {
this.singleton = singleton;
}
- public void setSignBundle(Boolean signBundle) {
+ void setSignBundle(Boolean signBundle) {
this.signBundle = signBundle;
}
- public void addJvmArg(String v) {
+ void addJvmArg(String v) {
jvmargs.add(v);
}
- public void addJvmProperty(String n, String v) {
+ void addJvmProperty(String n, String v) {
properties.put(n, v);
}
- public void setArguments(List<String> args) {
+ void setArguments(List<String> args) {
this.arguments = args;
}
- public List<String> getArguments() {
+ List<String> getArguments() {
return this.arguments;
}
- public void addArgument(String arg) {
+ void addArgument(String arg) {
this.arguments.add(arg);
}
- public void addAddModule(String value) {
+ void addAddModule(String value) {
if (addModules == null) {
addModules = value;
}
@@ -162,7 +159,7 @@
}
}
- public void addLimitModule(String value) {
+ void addLimitModule(String value) {
if (limitModules == null) {
limitModules = value;
}
@@ -171,27 +168,27 @@
}
}
- public String getModulePath() {
+ String getModulePath() {
return this.modulePath;
}
- public void setModulePath(String value) {
+ void setModulePath(String value) {
this.modulePath = value;
}
- public void setModule(String value) {
+ void setModule(String value) {
this.module = value;
}
- public void setDebug(String value) {
+ void setDebug(String value) {
this.debugPort = value;
}
- public void setStripNativeCommands(boolean value) {
+ void setStripNativeCommands(boolean value) {
this.stripNativeCommands = value;
}
- public void setDescription(String description) {
+ void setDescription(String description) {
this.description = description;
}
@@ -199,31 +196,31 @@
appId = id;
}
- public void setParams(List<Param> params) {
+ void setParams(List<Param> params) {
this.params = params;
}
- public void setTitle(String title) {
+ void setTitle(String title) {
this.title = title;
}
- public void setVendor(String vendor) {
+ void setVendor(String vendor) {
this.vendor = vendor;
}
- public void setEmail(String email) {
+ void setEmail(String email) {
this.email = email;
}
- public void setApplicationClass(String applicationClass) {
+ void setApplicationClass(String applicationClass) {
this.applicationClass = applicationClass;
}
- public void setJreInstaller(boolean value) {
+ void setJreInstaller(boolean value) {
jreInstaller = value;
}
- public File getOutput() {
+ File getOutput() {
return outdir;
}
@@ -297,7 +294,7 @@
null : baseDir.getAbsolutePath(), path);
}
- public static void validateAppName(String s) throws PackagerException {
+ static void validateAppName(String s) throws PackagerException {
if (s == null || s.length() == 0) {
// empty or null string - there is no unsupported char
return;
@@ -417,7 +414,7 @@
}
}
- public boolean validateForBundle() {
+ boolean validateForBundle() {
boolean result = false;
// Success
@@ -432,19 +429,19 @@
BundlerType bundleType = BundlerType.NONE;
String targetFormat = null; //means any
- public void setBundleType(BundlerType type) {
+ void setBundleType(BundlerType type) {
bundleType = type;
}
- public BundlerType getBundleType() {
+ BundlerType getBundleType() {
return bundleType;
}
- public void setTargetFormat(String t) {
+ void setTargetFormat(String t) {
targetFormat = t;
}
- public String getTargetFormat() {
+ String getTargetFormat() {
return targetFormat;
}
@@ -492,7 +489,7 @@
}
}
- public BundleParams getBundleParams() {
+ BundleParams getBundleParams() {
BundleParams bundleParams = new BundleParams();
//construct app resources
@@ -570,23 +567,23 @@
return bundleParams;
}
- public Map<String, ? super Object> getBundlerArguments() {
+ Map<String, ? super Object> getBundlerArguments() {
return this.bundlerArguments;
}
- public void putUnlessNull(String param, Object value) {
+ void putUnlessNull(String param, Object value) {
if (value != null) {
bundlerArguments.put(param, value);
}
}
- public void putUnlessNullOrEmpty(String param, Map<?, ?> value) {
+ void putUnlessNullOrEmpty(String param, Map<?, ?> value) {
if (value != null && !value.isEmpty()) {
bundlerArguments.put(param, value);
}
}
- public void putUnlessNullOrEmpty(String param, Collection<?> value) {
+ void putUnlessNullOrEmpty(String param, Collection<?> value) {
if (value != null && !value.isEmpty()) {
bundlerArguments.put(param, value);
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/EnumeratedBundlerParam.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/EnumeratedBundlerParam.java Mon Dec 10 16:48:25 2018 -0500
@@ -52,14 +52,14 @@
* }</pre>
*
*/
-public class EnumeratedBundlerParam<T> extends BundlerParamInfo<T> {
+class EnumeratedBundlerParam<T> extends BundlerParamInfo<T> {
// Not sure if this is the correct order, my idea is that from IDE
// perspective the string to display to the user is the key and then the
// value is some type of object (although probably a String in most cases)
private final Map<String, T> elements;
private final boolean strict;
- public EnumeratedBundlerParam(String name, String description,
+ EnumeratedBundlerParam(String name, String description,
String id, Class<T> valueType,
Function<Map<String, ? super Object>, T> defaultValueFunction,
BiFunction<String, Map<String, ? super Object>, T> stringConverter,
@@ -74,29 +74,29 @@
this.strict = strict;
}
- public boolean isInPossibleValues(T value) {
+ boolean isInPossibleValues(T value) {
return elements.values().contains(value);
}
// Having the displayable values as the keys seems a bit wacky
- public Set<String> getDisplayableKeys() {
+ Set<String> getDisplayableKeys() {
return Collections.unmodifiableSet(elements.keySet());
}
// mapping from a "displayable" key to an "identifier" value.
- public T getValueForDisplayableKey(String displayableKey) {
+ T getValueForDisplayableKey(String displayableKey) {
return elements.get(displayableKey);
}
- public boolean isStrict() {
+ boolean isStrict() {
return strict;
}
- public boolean isLoose() {
+ boolean isLoose() {
return !isStrict();
}
- public T validatedFetchFrom(Map<String, ? super Object> params)
+ T validatedFetchFrom(Map<String, ? super Object> params)
throws InvalidBundlerParamException {
if (isStrict()) {
T value = fetchFrom(params);
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java Mon Dec 10 16:48:25 2018 -0500
@@ -45,10 +45,9 @@
import java.util.ResourceBundle;
import java.util.Set;
-import jdk.jpackage.internal.AbstractAppImageBuilder;
import jdk.tools.jlink.internal.packager.AppRuntimeImageBuilder;
-public final class JLinkBundlerHelper {
+final class JLinkBundlerHelper {
private static final ResourceBundle I18N = ResourceBundle.getBundle(
"jdk.jpackage.internal.resources.MainResources");
@@ -60,7 +59,7 @@
private JLinkBundlerHelper() {}
@SuppressWarnings("unchecked")
- public static final BundlerParamInfo<String> JLINK_BUILDER =
+ static final BundlerParamInfo<String> JLINK_BUILDER =
new StandardBundlerParam<>(
I18N.getString("param.jlink-builder.name"),
I18N.getString("param.jlink-builder.description"),
@@ -70,7 +69,7 @@
(s, p) -> s);
@SuppressWarnings("unchecked")
- public static final BundlerParamInfo<Integer> DEBUG =
+ static final BundlerParamInfo<Integer> DEBUG =
new StandardBundlerParam<>(
"",
"",
@@ -81,7 +80,7 @@
return Integer.valueOf(s);
});
- public static String listOfPathToString(List<Path> value) {
+ static String listOfPathToString(List<Path> value) {
String result = "";
for (Path path : value) {
@@ -95,7 +94,7 @@
return result;
}
- public static String setOfStringToString(Set<String> value) {
+ static String setOfStringToString(Set<String> value) {
String result = "";
for (String element : value) {
@@ -109,7 +108,7 @@
return result;
}
- public static File getMainJar(Map<String, ? super Object> params) {
+ static File getMainJar(Map<String, ? super Object> params) {
File result = null;
RelativeFileSet fileset =
StandardBundlerParam.MAIN_JAR.fetchFrom(params);
@@ -132,7 +131,7 @@
return result;
}
- public static String getMainClass(Map<String, ? super Object> params) {
+ static String getMainClass(Map<String, ? super Object> params) {
String result = "";
String mainModule = StandardBundlerParam.MODULE.fetchFrom(params);
if (mainModule != null) {
@@ -153,7 +152,7 @@
return result;
}
- public static String getMainModule(Map<String, ? super Object> params) {
+ static String getMainModule(Map<String, ? super Object> params) {
String result = "";
String mainModule = StandardBundlerParam.MODULE.fetchFrom(params);
@@ -171,7 +170,7 @@
return result;
}
- public static String getJDKVersion(Map<String, ? super Object> params) {
+ static String getJDKVersion(Map<String, ? super Object> params) {
String result = "";
List<Path> modulePath =
StandardBundlerParam.MODULE_PATH.fetchFrom(params);
@@ -191,7 +190,7 @@
return result;
}
- public static Path getJDKHome(Map<String, ? super Object> params) {
+ static Path getJDKHome(Map<String, ? super Object> params) {
Path result = null;
List<Path> modulePath =
StandardBundlerParam.MODULE_PATH.fetchFrom(params);
@@ -234,7 +233,7 @@
return removeInvalidModules(modulePath, moduleHelper.modules());
}
- public static void execute(Map<String, ? super Object> params,
+ static void execute(Map<String, ? super Object> params,
AbstractAppImageBuilder imageBuilder)
throws IOException, Exception {
List<Path> modulePath =
@@ -305,7 +304,7 @@
imageBuilder.prepareApplicationFiles();
}
- public static void generateServerJre(Map<String, ? super Object> params,
+ static void generateServerJre(Map<String, ? super Object> params,
AbstractAppImageBuilder imageBuilder)
throws IOException, Exception {
List<Path> modulePath =
@@ -345,7 +344,7 @@
}
// Returns the path to the JDK modules in the user defined module path.
- public static Path findPathOfModule(
+ static Path findPathOfModule(
List<Path> modulePath, String moduleName) {
Path result = null;
@@ -432,12 +431,12 @@
private static final String ALL_MODULE_PATH = "ALL-MODULE-PATH";
// The token for "all redistributable runtime modules".
- public static final String ALL_RUNTIME = "ALL-RUNTIME";
+ static final String ALL_RUNTIME = "ALL-RUNTIME";
private final Set<String> modules = new HashSet<>();
private enum Macros {None, AllModulePath, AllRuntime}
- public ModuleHelper(List<Path> paths, Set<String> roots,
+ ModuleHelper(List<Path> paths, Set<String> roots,
Set<String> limitMods, String filename) {
Macros macro = Macros.None;
@@ -476,7 +475,7 @@
}
}
- public Set<String> modules() {
+ Set<String> modules() {
return modules;
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ModFile.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ModFile.java Mon Dec 10 16:48:25 2018 -0500
@@ -34,32 +34,32 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-public final class ModFile {
+final class ModFile {
private final String filename;
private final ModType moduleType;
- public enum JarType {All, UnnamedJar, ModularJar}
- public enum ModType {
+ enum JarType {All, UnnamedJar, ModularJar}
+ enum ModType {
Unknown, UnnamedJar, ModularJar, Jmod, ExplodedModule}
- public ModFile(File aFile) {
+ ModFile(File aFile) {
super();
filename = aFile.getPath();
moduleType = getModType(aFile);
}
- public String getModName() {
+ String getModName() {
File file = new File(getFileName());
// do not try to remove extension for directories
return moduleType == ModType.ExplodedModule ?
file.getName() : getFileWithoutExtension(file.getName());
}
- public String getFileName() {
+ String getFileName() {
return filename;
}
- public ModType getModType() {
+ ModType getModType() {
return moduleType;
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ModuleManager.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ModuleManager.java Mon Dec 10 16:48:25 2018 -0500
@@ -32,12 +32,12 @@
import java.util.EnumSet;
import java.util.List;
-public final class ModuleManager {
+final class ModuleManager {
private final List<String> folders = new ArrayList<String>();
- public enum SearchType {UnnamedJar, ModularJar, Jmod, ExplodedModule}
+ enum SearchType {UnnamedJar, ModularJar, Jmod, ExplodedModule}
- public ModuleManager(String folders) {
+ ModuleManager(String folders) {
super();
String lfolders = folders.replaceAll("^\"|\"$", "");
List<Path> paths = new ArrayList<Path>();
@@ -51,7 +51,7 @@
initialize(paths);
}
- public ModuleManager(List<Path> Paths) {
+ ModuleManager(List<Path> Paths) {
super();
initialize(Paths);
}
@@ -62,13 +62,13 @@
}
}
- public List<ModFile> getModules() {
+ List<ModFile> getModules() {
return getModules(EnumSet.of(SearchType.UnnamedJar,
SearchType.ModularJar, SearchType.Jmod,
SearchType.ExplodedModule));
}
- public List<ModFile> getModules(EnumSet<SearchType> Search) {
+ List<ModFile> getModules(EnumSet<SearchType> Search) {
List<ModFile> result = new ArrayList<ModFile>();
for (String folder : folders) {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Param.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Param.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,15 +25,15 @@
package jdk.jpackage.internal;
-public class Param {
+class Param {
String name;
String value;
- public void setName(String name) {
+ void setName(String name) {
this.name = name;
}
- public void setValue(String value) {
+ void setValue(String value) {
this.value = value;
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Platform.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Platform.java Mon Dec 10 16:48:25 2018 -0500
@@ -49,7 +49,7 @@
* }
*
*/
-public enum Platform {UNKNOWN, WINDOWS, LINUX, MAC;
+enum Platform {UNKNOWN, WINDOWS, LINUX, MAC;
private static final Platform platform;
private static final int majorVersion;
private static final int minorVersion;
@@ -91,15 +91,15 @@
private Platform() {}
- public static Platform getPlatform() {
+ static Platform getPlatform() {
return platform;
}
- public static int getMajorVersion() {
+ static int getMajorVersion() {
return majorVersion;
}
- public static int getMinorVersion() {
+ static int getMinorVersion() {
return minorVersion;
}
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RedistributableModules.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RedistributableModules.java Mon Dec 10 16:48:25 2018 -0500
@@ -45,12 +45,12 @@
import jdk.tools.jlink.internal.packager.AppRuntimeImageBuilder;
-public final class RedistributableModules {
+final class RedistributableModules {
private static final String JDK_JPACKAGE_MODULE = "jdk.jpackage";
private RedistributableModules() {}
- public static String stripComments(String line) {
+ static String stripComments(String line) {
String result = line.trim();
int i = result.indexOf(";");
@@ -62,7 +62,7 @@
return result;
}
- public static Set<String> getRedistributableModules(List<Path> modulePath,
+ static Set<String> getRedistributableModules(List<Path> modulePath,
String filename) {
Set<String> result = null;
@@ -121,7 +121,7 @@
return result;
}
- public static String getModuleVersion(File moduleFile,
+ static String getModuleVersion(File moduleFile,
List<Path> modulePath, Set<String> addModules,
Set<String> limitModules) {
String result = "";
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RelativeFileSet.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RelativeFileSet.java Mon Dec 10 16:48:25 2018 -0500
@@ -35,7 +35,7 @@
*
* A class encapsulating a directory and a set of files within it.
*/
-public class RelativeFileSet {
+class RelativeFileSet {
private String mode;
private String os;
@@ -44,7 +44,7 @@
private File basedir;
private Set<String> files = new LinkedHashSet<>();
- public RelativeFileSet(RelativeFileSet copy) {
+ RelativeFileSet(RelativeFileSet copy) {
mode = copy.mode;
os = copy.os;
arch = copy.arch;
@@ -52,7 +52,7 @@
files = new LinkedHashSet<>(copy.files);
}
- public RelativeFileSet(File base, Collection<File> files) {
+ RelativeFileSet(File base, Collection<File> files) {
basedir = base;
String baseAbsolute = basedir.getAbsolutePath();
for (File f: files) {
@@ -68,7 +68,7 @@
}
}
- public void upshift() {
+ void upshift() {
String root = basedir.getName();
basedir = basedir.getParentFile();
Set<String> newFiles = new LinkedHashSet<>();
@@ -78,11 +78,11 @@
files = newFiles;
}
- public RelativeFileSet(File base, Set<File> files) {
+ RelativeFileSet(File base, Set<File> files) {
this(base, (Collection<File>) files);
}
- public boolean contains(String[] requiredFiles) {
+ boolean contains(String[] requiredFiles) {
boolean result = true;
for(String fname: requiredFiles) {
@@ -95,7 +95,7 @@
return result;
}
- public boolean contains(String requiredFile) {
+ boolean contains(String requiredFile) {
if (files.contains(requiredFile)) {
return true;
} else {
@@ -104,15 +104,15 @@
}
}
- public File getBaseDirectory() {
+ File getBaseDirectory() {
return basedir;
}
- public Set<String> getIncludedFiles() {
+ Set<String> getIncludedFiles() {
return files;
}
- public void dump() {
+ void dump() {
Log.verbose("\n=========\nBasedir: " + basedir + "\n");
for (String fname : files) {
Log.verbose(" " + fname);
@@ -120,27 +120,27 @@
Log.verbose("\n========");
}
- public String getMode() {
+ String getMode() {
return mode;
}
- public void setMode(String mode) {
+ void setMode(String mode) {
this.mode = mode;
}
- public String getOs() {
+ String getOs() {
return os;
}
- public void setOs(String os) {
+ void setOs(String os) {
this.os = os;
}
- public String getArch() {
+ String getArch() {
return arch;
}
- public void setArch(String arch) {
+ void setArch(String arch) {
this.arch = arch;
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/SecondaryLauncherArguments.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/SecondaryLauncherArguments.java Mon Dec 10 16:48:25 2018 -0500
@@ -61,13 +61,13 @@
* win-console
*
*/
-public class SecondaryLauncherArguments {
+class SecondaryLauncherArguments {
private final String filename;
private Map<String, String> allArgs;
private Map<String, ? super Object> bundleParams;
- public SecondaryLauncherArguments(String filename) {
+ SecondaryLauncherArguments(String filename) {
this.filename = filename;
}
@@ -139,7 +139,7 @@
return null;
}
- public Map<String, ? super Object> getLauncherMap() {
+ Map<String, ? super Object> getLauncherMap() {
initLauncherMap();
return bundleParams;
}
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java Mon Dec 10 16:48:25 2018 -0500
@@ -68,13 +68,13 @@
*
* Also contains static methods that operate on maps of parameters.
*/
-public class StandardBundlerParam<T> extends BundlerParamInfo<T> {
+class StandardBundlerParam<T> extends BundlerParamInfo<T> {
private static final ResourceBundle I18N = ResourceBundle.getBundle(
"jdk.jpackage.internal.resources.MainResources");
private static final String JAVABASEJMOD = "java.base.jmod";
- public StandardBundlerParam(String name, String description, String id,
+ StandardBundlerParam(String name, String description, String id,
Class<T> valueType,
Function<Map<String, ? super Object>, T> defaultValueFunction,
BiFunction<String, Map<String, ? super Object>, T> stringConverter)
@@ -87,7 +87,7 @@
this.stringConverter = stringConverter;
}
- public static final StandardBundlerParam<RelativeFileSet> APP_RESOURCES =
+ static final StandardBundlerParam<RelativeFileSet> APP_RESOURCES =
new StandardBundlerParam<>(
I18N.getString("param.app-resources.name"),
I18N.getString("param.app-resource.description"),
@@ -99,7 +99,7 @@
);
@SuppressWarnings("unchecked")
- public static final
+ static final
StandardBundlerParam<List<RelativeFileSet>> APP_RESOURCES_LIST =
new StandardBundlerParam<>(
I18N.getString("param.app-resources-list.name"),
@@ -112,7 +112,7 @@
StandardBundlerParam::createAppResourcesListFromString
);
- public static final StandardBundlerParam<String> SOURCE_DIR =
+ static final StandardBundlerParam<String> SOURCE_DIR =
new StandardBundlerParam<>(
I18N.getString("param.source-dir.name"),
I18N.getString("param.source-dir.description"),
@@ -132,7 +132,7 @@
);
@SuppressWarnings("unchecked")
- public static final StandardBundlerParam<List<File>> SOURCE_FILES =
+ static final StandardBundlerParam<List<File>> SOURCE_FILES =
new StandardBundlerParam<>(
I18N.getString("param.source-files.name"),
I18N.getString("param.source-files.description"),
@@ -144,7 +144,7 @@
// note that each bundler is likely to replace this one with
// their own converter
- public static final StandardBundlerParam<RelativeFileSet> MAIN_JAR =
+ static final StandardBundlerParam<RelativeFileSet> MAIN_JAR =
new StandardBundlerParam<>(
I18N.getString("param.main-jar.name"),
I18N.getString("param.main-jar.description"),
@@ -158,7 +158,7 @@
);
// TODO: test CLASSPATH jar manifest Attributet
- public static final StandardBundlerParam<String> CLASSPATH =
+ static final StandardBundlerParam<String> CLASSPATH =
new StandardBundlerParam<>(
I18N.getString("param.classpath.name"),
I18N.getString("param.classpath.description"),
@@ -172,7 +172,7 @@
(s, p) -> s.replace(File.pathSeparator, " ")
);
- public static final StandardBundlerParam<String> MAIN_CLASS =
+ static final StandardBundlerParam<String> MAIN_CLASS =
new StandardBundlerParam<>(
I18N.getString("param.main-class.name"),
I18N.getString("param.main-class.description"),
@@ -193,7 +193,7 @@
(s, p) -> s
);
- public static final StandardBundlerParam<String> APP_NAME =
+ static final StandardBundlerParam<String> APP_NAME =
new StandardBundlerParam<>(
I18N.getString("param.app-name.name"),
I18N.getString("param.app-name.description"),
@@ -215,7 +215,7 @@
private static Pattern TO_FS_NAME = Pattern.compile("\\s|[\\\\/?:*<>|]");
// keep out invalid/undesireable filename characters
- public static final StandardBundlerParam<String> APP_FS_NAME =
+ static final StandardBundlerParam<String> APP_FS_NAME =
new StandardBundlerParam<>(
I18N.getString("param.app-fs-name.name"),
I18N.getString("param.app-fs-name.description"),
@@ -226,7 +226,7 @@
(s, p) -> s
);
- public static final StandardBundlerParam<File> ICON =
+ static final StandardBundlerParam<File> ICON =
new StandardBundlerParam<>(
I18N.getString("param.icon-file.name"),
I18N.getString("param.icon-file.description"),
@@ -236,7 +236,7 @@
(s, p) -> new File(s)
);
- public static final StandardBundlerParam<String> VENDOR =
+ static final StandardBundlerParam<String> VENDOR =
new StandardBundlerParam<>(
I18N.getString("param.vendor.name"),
I18N.getString("param.vendor.description"),
@@ -246,7 +246,7 @@
(s, p) -> s
);
- public static final StandardBundlerParam<String> CATEGORY =
+ static final StandardBundlerParam<String> CATEGORY =
new StandardBundlerParam<>(
I18N.getString("param.category.name"),
I18N.getString("param.category.description"),
@@ -256,7 +256,7 @@
(s, p) -> s
);
- public static final StandardBundlerParam<String> DESCRIPTION =
+ static final StandardBundlerParam<String> DESCRIPTION =
new StandardBundlerParam<>(
I18N.getString("param.description.name"),
I18N.getString("param.description.description"),
@@ -268,7 +268,7 @@
(s, p) -> s
);
- public static final StandardBundlerParam<String> COPYRIGHT =
+ static final StandardBundlerParam<String> COPYRIGHT =
new StandardBundlerParam<>(
I18N.getString("param.copyright.name"),
I18N.getString("param.copyright.description"),
@@ -280,7 +280,7 @@
);
@SuppressWarnings("unchecked")
- public static final StandardBundlerParam<List<String>> ARGUMENTS =
+ static final StandardBundlerParam<List<String>> ARGUMENTS =
new StandardBundlerParam<>(
I18N.getString("param.arguments.name"),
I18N.getString("param.arguments.description"),
@@ -291,7 +291,7 @@
);
@SuppressWarnings("unchecked")
- public static final StandardBundlerParam<List<String>> JVM_OPTIONS =
+ static final StandardBundlerParam<List<String>> JVM_OPTIONS =
new StandardBundlerParam<>(
I18N.getString("param.jvm-options.name"),
I18N.getString("param.jvm-options.description"),
@@ -302,8 +302,7 @@
);
@SuppressWarnings("unchecked")
- public static final
- StandardBundlerParam<Map<String, String>> JVM_PROPERTIES =
+ static final StandardBundlerParam<Map<String, String>> JVM_PROPERTIES =
new StandardBundlerParam<>(
I18N.getString("param.jvm-system-properties.name"),
I18N.getString("param.jvm-system-properties.description"),
@@ -327,7 +326,7 @@
}
);
- public static final StandardBundlerParam<String> TITLE =
+ static final StandardBundlerParam<String> TITLE =
new StandardBundlerParam<>(
I18N.getString("param.title.name"),
I18N.getString("param.title.description"),
@@ -339,7 +338,7 @@
// note that each bundler is likely to replace this one with
// their own converter
- public static final StandardBundlerParam<String> VERSION =
+ static final StandardBundlerParam<String> VERSION =
new StandardBundlerParam<>(
I18N.getString("param.version.name"),
I18N.getString("param.version.description"),
@@ -350,7 +349,7 @@
);
@SuppressWarnings("unchecked")
- public static final StandardBundlerParam<List<String>> LICENSE_FILE =
+ static final StandardBundlerParam<List<String>> LICENSE_FILE =
new StandardBundlerParam<>(
I18N.getString("param.license-file.name"),
I18N.getString("param.license-file.description"),
@@ -360,7 +359,7 @@
(s, p) -> Arrays.asList(s.split(","))
);
- public static final StandardBundlerParam<File> BUILD_ROOT =
+ static final StandardBundlerParam<File> BUILD_ROOT =
new StandardBundlerParam<>(
I18N.getString("param.build-root.name"),
I18N.getString("param.build-root.description"),
@@ -377,7 +376,7 @@
(s, p) -> new File(s)
);
- public static final StandardBundlerParam<String> IDENTIFIER =
+ static final StandardBundlerParam<String> IDENTIFIER =
new StandardBundlerParam<>(
I18N.getString("param.identifier.name"),
I18N.getString("param.identifier.description"),
@@ -396,7 +395,7 @@
(s, p) -> s
);
- public static final StandardBundlerParam<String> PREFERENCES_ID =
+ static final StandardBundlerParam<String> PREFERENCES_ID =
new StandardBundlerParam<>(
I18N.getString("param.preferences-id.name"),
I18N.getString("param.preferences-id.description"),
@@ -407,7 +406,7 @@
(s, p) -> s
);
- public static final StandardBundlerParam<Boolean> VERBOSE =
+ static final StandardBundlerParam<Boolean> VERBOSE =
new StandardBundlerParam<>(
I18N.getString("param.verbose.name"),
I18N.getString("param.verbose.description"),
@@ -419,7 +418,7 @@
true : Boolean.valueOf(s)
);
- public static final StandardBundlerParam<Boolean> FORCE =
+ static final StandardBundlerParam<Boolean> FORCE =
new StandardBundlerParam<>(
I18N.getString("param.force.name"),
I18N.getString("param.force.description"),
@@ -431,7 +430,7 @@
true : Boolean.valueOf(s)
);
- public static final StandardBundlerParam<File> DROP_IN_RESOURCES_ROOT =
+ static final StandardBundlerParam<File> DROP_IN_RESOURCES_ROOT =
new StandardBundlerParam<>(
I18N.getString("param.drop-in-resources-root.name"),
I18N.getString("param.drop-in-resources-root.description"),
@@ -441,7 +440,7 @@
(s, p) -> new File(s)
);
- public static final BundlerParamInfo<String> INSTALL_DIR =
+ static final BundlerParamInfo<String> INSTALL_DIR =
new StandardBundlerParam<>(
I18N.getString("param.install-dir.name"),
I18N.getString("param.install-dir.description"),
@@ -451,7 +450,7 @@
(s, p) -> s
);
- public static final StandardBundlerParam<File> PREDEFINED_APP_IMAGE =
+ static final StandardBundlerParam<File> PREDEFINED_APP_IMAGE =
new StandardBundlerParam<>(
I18N.getString("param.predefined-app-image.name"),
I18N.getString("param.predefined-app-image.description"),
@@ -460,7 +459,7 @@
params -> null,
(s, p) -> new File(s));
- public static final StandardBundlerParam<File> PREDEFINED_RUNTIME_IMAGE =
+ static final StandardBundlerParam<File> PREDEFINED_RUNTIME_IMAGE =
new StandardBundlerParam<>(
I18N.getString("param.predefined-runtime-image.name"),
I18N.getString("param.predefined-runtime-image.description"),
@@ -470,7 +469,7 @@
(s, p) -> new File(s));
@SuppressWarnings("unchecked")
- public static final StandardBundlerParam<List<Map<String, ? super Object>>> SECONDARY_LAUNCHERS =
+ static final StandardBundlerParam<List<Map<String, ? super Object>>> SECONDARY_LAUNCHERS =
new StandardBundlerParam<>(
I18N.getString("param.secondary-launchers.name"),
I18N.getString("param.secondary-launchers.description"),
@@ -483,7 +482,7 @@
);
@SuppressWarnings("unchecked")
- public static final StandardBundlerParam
+ static final StandardBundlerParam
<List<Map<String, ? super Object>>> FILE_ASSOCIATIONS =
new StandardBundlerParam<>(
I18N.getString("param.file-associations.name"),
@@ -497,7 +496,7 @@
);
@SuppressWarnings("unchecked")
- public static final StandardBundlerParam<List<String>> FA_EXTENSIONS =
+ static final StandardBundlerParam<List<String>> FA_EXTENSIONS =
new StandardBundlerParam<>(
I18N.getString("param.fa-extension.name"),
I18N.getString("param.fa-extension.description"),
@@ -508,7 +507,7 @@
);
@SuppressWarnings("unchecked")
- public static final StandardBundlerParam<List<String>> FA_CONTENT_TYPE =
+ static final StandardBundlerParam<List<String>> FA_CONTENT_TYPE =
new StandardBundlerParam<>(
I18N.getString("param.fa-content-type.name"),
I18N.getString("param.fa-content-type.description"),
@@ -519,7 +518,7 @@
(s, p) -> Arrays.asList(s.split("(,|\\s)+"))
);
- public static final StandardBundlerParam<String> FA_DESCRIPTION =
+ static final StandardBundlerParam<String> FA_DESCRIPTION =
new StandardBundlerParam<>(
I18N.getString("param.fa-description.name"),
I18N.getString("param.fa-description.description"),
@@ -529,7 +528,7 @@
null
);
- public static final StandardBundlerParam<File> FA_ICON =
+ static final StandardBundlerParam<File> FA_ICON =
new StandardBundlerParam<>(
I18N.getString("param.fa-icon.name"),
I18N.getString("param.fa-icon.description"),
@@ -540,7 +539,7 @@
);
@SuppressWarnings("unchecked")
- public static final BundlerParamInfo<List<Path>> MODULE_PATH =
+ static final BundlerParamInfo<List<Path>> MODULE_PATH =
new StandardBundlerParam<>(
I18N.getString("param.module-path.name"),
I18N.getString("param.module-path.description"),
@@ -581,7 +580,7 @@
return modulePath;
});
- public static final BundlerParamInfo<String> MODULE =
+ static final BundlerParamInfo<String> MODULE =
new StandardBundlerParam<>(
I18N.getString("param.main.module.name"),
I18N.getString("param.main.module.description"),
@@ -593,7 +592,7 @@
});
@SuppressWarnings("unchecked")
- public static final BundlerParamInfo<Set<String>> ADD_MODULES =
+ static final BundlerParamInfo<Set<String>> ADD_MODULES =
new StandardBundlerParam<>(
I18N.getString("param.add-modules.name"),
I18N.getString("param.add-modules.description"),
@@ -604,7 +603,7 @@
);
@SuppressWarnings("unchecked")
- public static final BundlerParamInfo<Set<String>> LIMIT_MODULES =
+ static final BundlerParamInfo<Set<String>> LIMIT_MODULES =
new StandardBundlerParam<>(
I18N.getString("param.limit-modules.name"),
I18N.getString("param.limit-modules.description"),
@@ -614,7 +613,7 @@
(s, p) -> new LinkedHashSet<>(Arrays.asList(s.split(",")))
);
- public static final BundlerParamInfo<Boolean> STRIP_NATIVE_COMMANDS =
+ static final BundlerParamInfo<Boolean> STRIP_NATIVE_COMMANDS =
new StandardBundlerParam<>(
I18N.getString("param.strip-executables.name"),
I18N.getString("param.strip-executables.description"),
@@ -624,7 +623,7 @@
(s, p) -> Boolean.valueOf(s)
);
- public static final BundlerParamInfo<Boolean> SINGLETON =
+ static final BundlerParamInfo<Boolean> SINGLETON =
new StandardBundlerParam<> (
I18N.getString("param.singleton.name"),
I18N.getString("param.singleton.description"),
@@ -634,7 +633,7 @@
(s, p) -> Boolean.valueOf(s)
);
- public static File getPredefinedAppImage(Map<String, ? super Object> p) {
+ static File getPredefinedAppImage(Map<String, ? super Object> p) {
File applicationImage = null;
if (PREDEFINED_APP_IMAGE.fetchFrom(p) != null) {
applicationImage = PREDEFINED_APP_IMAGE.fetchFrom(p);
@@ -650,7 +649,7 @@
return applicationImage;
}
- public static void copyPredefinedRuntimeImage(
+ static void copyPredefinedRuntimeImage(
Map<String, ? super Object> p,
AbstractAppImageBuilder appBuilder)
throws IOException , ConfigException {
@@ -669,7 +668,7 @@
appBuilder.prepareApplicationFiles();
}
- public static void extractMainClassInfoFromAppResources(
+ static void extractMainClassInfoFromAppResources(
Map<String, ? super Object> params) {
boolean hasMainClass = params.containsKey(MAIN_CLASS.getID());
boolean hasMainJar = params.containsKey(MAIN_JAR.getID());
@@ -756,7 +755,7 @@
}
}
- public static void validateMainClassInfoFromAppResources(
+ static void validateMainClassInfoFromAppResources(
Map<String, ? super Object> params) throws ConfigException {
boolean hasMainClass = params.containsKey(MAIN_CLASS.getID());
boolean hasMainJar = params.containsKey(MAIN_JAR.getID());
@@ -876,7 +875,7 @@
"error.main-jar-does-not-exist.advice")));
}
- public static List<Path> getDefaultModulePath() {
+ static List<Path> getDefaultModulePath() {
List<Path> result = new ArrayList<Path>();
Path jdkModulePath = Paths.get(
System.getProperty("java.home"), "jmods").toAbsolutePath();
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java Mon Dec 10 16:48:25 2018 -0500
@@ -42,7 +42,7 @@
* checkIfSupported(CLIOptions mode, CLIOptions arg)
* Determine if the given arg is valid in the given mode.
*/
-public class ValidOptions {
+class ValidOptions {
private ValidOptions() {};
@@ -198,7 +198,7 @@
argsInitialized = true;
}
- public static void add(CLIOptions mode, CLIOptions arg) {
+ static void add(CLIOptions mode, CLIOptions arg) {
if (mode.equals(arg)) {
return;
}
@@ -206,7 +206,7 @@
k -> new HashSet<>()).add(arg);
}
- public static boolean checkIfSupported(CLIOptions mode, CLIOptions arg) {
+ static boolean checkIfSupported(CLIOptions mode, CLIOptions arg) {
if (mode.equals(arg)) {
return true;
}
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,19 +25,7 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.AbstractImageBundler;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.ConfigException;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.Platform;
-import jdk.jpackage.internal.StandardBundlerParam;
-import jdk.jpackage.internal.UnsupportedPlatformException;
-import jdk.jpackage.internal.WindowsAppImageBuilder;
import jdk.jpackage.internal.resources.WinResources;
-import jdk.jpackage.internal.JLinkBundlerHelper;
-import jdk.jpackage.internal.Arguments;
-import jdk.jpackage.internal.AbstractAppImageBuilder;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -57,7 +45,7 @@
private static final ResourceBundle I18N = ResourceBundle.getBundle(
"jdk.jpackage.internal.resources.WinResources");
- public static final BundlerParamInfo<File> ICON_ICO =
+ static final BundlerParamInfo<File> ICON_ICO =
new StandardBundlerParam<>(
I18N.getString("param.icon-ico.name"),
I18N.getString("param.icon-ico.description"),
@@ -102,7 +90,7 @@
// to be used by chained bundlers, e.g. by EXE bundler to avoid
// skipping validation if p.type does not include "image"
- boolean doValidate(Map<String, ? super Object> p)
+ private boolean doValidate(Map<String, ? super Object> p)
throws UnsupportedPlatformException, ConfigException {
if (Platform.getPlatform() != Platform.WINDOWS) {
throw new UnsupportedPlatformException();
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,10 +25,6 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.*;
-import jdk.jpackage.internal.ConfigException;
-import jdk.jpackage.internal.Arguments;
-import jdk.jpackage.internal.UnsupportedPlatformException;
import jdk.jpackage.internal.resources.WinResources;
import java.io.*;
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,10 +25,6 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.*;
-import jdk.jpackage.internal.ConfigException;
-import jdk.jpackage.internal.Arguments;
-import jdk.jpackage.internal.UnsupportedPlatformException;
import jdk.jpackage.internal.resources.WinResources;
import java.io.*;
@@ -324,7 +320,7 @@
// run basic validation to ensure requirements are met
// we are not interested in return code, only possible exception
- APP_BUNDLER.fetchFrom(p).doValidate(p);
+ APP_BUNDLER.fetchFrom(p).validate(p);
double candleVersion =
findToolVersion(TOOL_CANDLE_EXECUTABLE.fetchFrom(p));
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,15 +25,7 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.Log;
-import jdk.jpackage.internal.RelativeFileSet;
-import jdk.jpackage.internal.IOUtils;
-import jdk.jpackage.internal.StandardBundlerParam;
import jdk.jpackage.internal.resources.WinResources;
-import jdk.jpackage.internal.WindowsBundlerParam;
-import jdk.jpackage.internal.AbstractAppImageBuilder;
-import jdk.jpackage.internal.WindowsDefender;
import java.io.File;
import java.io.FileOutputStream;
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsBundlerParam.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsBundlerParam.java Mon Dec 10 16:48:25 2018 -0500
@@ -25,23 +25,19 @@
package jdk.jpackage.internal;
-import jdk.jpackage.internal.BundlerParamInfo;
-import jdk.jpackage.internal.StandardBundlerParam;
-import jdk.jpackage.internal.Arguments;
-import jdk.jpackage.internal.RelativeFileSet;
-import jdk.jpackage.internal.BundleParams;
+import jdk.jpackage.internal.resources.WinResources;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.function.BiFunction;
import java.util.function.Function;
-public class WindowsBundlerParam<T> extends StandardBundlerParam<T> {
+class WindowsBundlerParam<T> extends StandardBundlerParam<T> {
private static final ResourceBundle I18N = ResourceBundle.getBundle(
"jdk.jpackage.internal.resources.WinResources");
- public WindowsBundlerParam(String name, String description, String id,
+ WindowsBundlerParam(String name, String description, String id,
Class<T> valueType,
Function<Map<String, ? super Object>, T> defaultValueFunction,
BiFunction<String,
@@ -50,7 +46,7 @@
defaultValueFunction, stringConverter);
}
- public static final BundlerParamInfo<String> INSTALLER_FILE_NAME =
+ static final BundlerParamInfo<String> INSTALLER_FILE_NAME =
new StandardBundlerParam<> (
I18N.getString("param.installer-name.name"),
I18N.getString("param.installer-name.description"),
@@ -69,7 +65,7 @@
},
(s, p) -> s);
- public static final BundlerParamInfo<String> APP_REGISTRY_NAME =
+ static final BundlerParamInfo<String> APP_REGISTRY_NAME =
new StandardBundlerParam<> (
I18N.getString("param.registry-name.name"),
I18N.getString("param.registry-name.description"),
@@ -83,7 +79,7 @@
},
(s, p) -> s);
- public static final StandardBundlerParam<String> MENU_GROUP =
+ static final StandardBundlerParam<String> MENU_GROUP =
new StandardBundlerParam<>(
I18N.getString("param.menu-group.name"),
I18N.getString("param.menu-group.description"),
@@ -97,7 +93,7 @@
(s, p) -> s
);
- public static final StandardBundlerParam<Boolean> BIT_ARCH_64 =
+ static final StandardBundlerParam<Boolean> BIT_ARCH_64 =
new StandardBundlerParam<>(
I18N.getString("param.64-bit.name"),
I18N.getString("param.64-bit.description"),
@@ -107,7 +103,7 @@
(s, p) -> Boolean.valueOf(s)
);
- public static final StandardBundlerParam<Boolean> BIT_ARCH_64_RUNTIME =
+ static final StandardBundlerParam<Boolean> BIT_ARCH_64_RUNTIME =
new StandardBundlerParam<>(
I18N.getString("param.runtime-64-bit.name"),
I18N.getString("param.runtime-64-bit.description"),
@@ -120,7 +116,7 @@
(s, p) -> Boolean.valueOf(s)
);
- public static final BundlerParamInfo<Boolean> INSTALLDIR_CHOOSER =
+ static final BundlerParamInfo<Boolean> INSTALLDIR_CHOOSER =
new StandardBundlerParam<> (
I18N.getString("param.installdir-chooser.name"),
I18N.getString("param.installdir-chooser.description"),
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsDefender.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsDefender.java Mon Dec 10 16:48:25 2018 -0500
@@ -28,11 +28,11 @@
import jdk.jpackage.internal.Platform;
import java.util.List;
-public final class WindowsDefender {
+final class WindowsDefender {
private WindowsDefender() {}
- public static final boolean isThereAPotentialWindowsDefenderIssue() {
+ static final boolean isThereAPotentialWindowsDefenderIssue() {
boolean result = false;
if (Platform.getPlatform() == Platform.WINDOWS &&
@@ -66,7 +66,7 @@
return result;
}
- public static final String getUserTempDirectory() {
+ static final String getUserTempDirectory() {
String tempDirectory = System.getProperty("java.io.tmpdir");
return tempDirectory;
}
--- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsRegistry.java Fri Dec 07 21:07:26 2018 -0500
+++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsRegistry.java Mon Dec 10 16:48:25 2018 -0500
@@ -36,7 +36,7 @@
import static jdk.jpackage.internal.IOUtils.exec;
-public final class WindowsRegistry {
+final class WindowsRegistry {
private WindowsRegistry() {}
@@ -45,7 +45,7 @@
* @return true if DisableRealtimeMonitoring is set to 0x1,
* false otherwise.
*/
- public static final boolean readDisableRealtimeMonitoring() {
+ static final boolean readDisableRealtimeMonitoring() {
boolean result = false;
final String key = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\"
+ "Windows Defender\\Real-Time Protection";
@@ -75,7 +75,7 @@
return result;
}
- public static final List<String> readExclusionsPaths() {
+ static final List<String> readExclusionsPaths() {
List<String> result = new ArrayList<String>();
final String key = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\"
+ "Windows Defender\\Exclusions\\Paths";
@@ -112,7 +112,7 @@
* @param subkey in the registry key
* @return registry value or null if not found
*/
- public static final String readRegistry(String key, String subkey){
+ static final String readRegistry(String key, String subkey){
String result = "";
try {