--- old/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java 2019-06-23 08:53:28.059049200 -0400 +++ new/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java 2019-06-23 08:53:25.750204800 -0400 @@ -113,36 +113,11 @@ this.params = new HashMap<>(); } - private Path destFile(String dir, String filename) { - return runtimeDir.resolve(dir).resolve(filename); - } - private void writeEntry(InputStream in, Path dstFile) throws IOException { Files.createDirectories(dstFile.getParent()); Files.copy(in, dstFile); } - private void writeSymEntry(Path dstFile, Path target) throws IOException { - Files.createDirectories(dstFile.getParent()); - Files.createLink(dstFile, target); - } - - /** - * chmod ugo+x file - */ - private void setExecutable(Path file) { - try { - Set perms = - Files.getPosixFilePermissions(file); - perms.add(PosixFilePermission.OWNER_EXECUTE); - perms.add(PosixFilePermission.GROUP_EXECUTE); - perms.add(PosixFilePermission.OTHERS_EXECUTE); - Files.setPosixFilePermissions(file, perms); - } catch (IOException ioe) { - throw new UncheckedIOException(ioe); - } - } - // it is static for the sake of sharing with "installer" bundlers // that may skip calls to validate/bundle in this class! public static File getRootDir(File outDir, --- old/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java 2019-06-23 08:53:41.537708400 -0400 +++ new/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java 2019-06-23 08:53:39.182063100 -0400 @@ -756,12 +756,6 @@ return new File(rootDir, APP_NAME.fetchFrom(params) + ".png"); } - private File getConfig_InitScriptFile(Map params) { - return new File(LinuxAppBundler.getRootDir( - APP_IMAGE_ROOT.fetchFrom(params), params), - BUNDLE_NAME.fetchFrom(params) + ".init"); - } - private File getConfig_ControlFile(Map params) { return new File(CONFIG_DIR.fetchFrom(params), "control"); } --- old/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java 2019-06-23 08:53:54.673161000 -0400 +++ new/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java 2019-06-23 08:53:52.676322600 -0400 @@ -211,28 +211,6 @@ Files.copy(in, dstFile); } - // chmod ugo+x file - private void setExecutable(Path file) { - try { - Set perms = - Files.getPosixFilePermissions(file); - perms.add(PosixFilePermission.OWNER_EXECUTE); - perms.add(PosixFilePermission.GROUP_EXECUTE); - perms.add(PosixFilePermission.OTHERS_EXECUTE); - Files.setPosixFilePermissions(file, perms); - } catch (IOException ioe) { - throw new UncheckedIOException(ioe); - } - } - - private static void createUtf8File(File file, String content) - throws IOException { - try (OutputStream fout = new FileOutputStream(file); - Writer output = new OutputStreamWriter(fout, "UTF-8")) { - output.write(content); - } - } - public static boolean validCFBundleVersion(String v) { // CFBundleVersion (String - iOS, OS X) specifies the build version // number of the bundle, which identifies an iteration (released or --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java 2019-06-23 08:54:06.825794700 -0400 +++ new/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java 2019-06-23 08:54:04.750954800 -0400 @@ -54,11 +54,9 @@ private static final ResourceBundle I18N = ResourceBundle.getBundle( "jdk.jpackage.internal.resources.MainResources"); - private final Map properties; private final Path root; - public AbstractAppImageBuilder(Map properties, Path root) { - this.properties = properties; + public AbstractAppImageBuilder(Map unused, Path root) { this.root = root; } @@ -71,10 +69,6 @@ public abstract Path getAppDir(); public abstract Path getAppModsDir(); - public Map getProperties() { - return this.properties; - } - public Path getRoot() { return this.root; } --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java 2019-06-23 08:54:20.118059200 -0400 +++ new/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java 2019-06-23 08:54:18.230422900 -0400 @@ -155,13 +155,6 @@ } } - private void putUnlessNullOrEmpty(Map params, - String param, Map value) { - if (value != null && !value.isEmpty()) { - params.put(param, value); - } - } - static Map merge( Map original, Map additional) { --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java 2019-06-23 08:54:32.738701900 -0400 +++ new/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java 2019-06-23 08:54:30.773064100 -0400 @@ -64,7 +64,6 @@ private static final ResourceBundle I18N = ResourceBundle.getBundle( "jdk.jpackage.internal.resources.MainResources"); - private static final String IMAGE_PACKAGE_TYPE = "app-image"; private static final String FA_EXTENSIONS = "extension"; private static final String FA_CONTENT_TYPE = "mime-type"; private static final String FA_DESCRIPTION = "description"; @@ -377,8 +376,7 @@ } String getIdWithPrefix() { - String prefix = isMode() ? "" : "--"; - return prefix + this.id; + return "--" + this.id; } String getShortIdWithPrefix() { @@ -393,10 +391,6 @@ } } - boolean isMode() { - return category == OptionCategories.MODE; - } - OptionCategories getCategory() { return category; } @@ -424,17 +418,12 @@ context().pos++; } - private static void prevArg() { - context().pos--; - } - private static boolean hasNextArg() { return context().pos < context().argList.size(); } } enum OptionCategories { - MODE, MODULAR, PROPERTY, PLATFORM_MAC, @@ -541,7 +530,7 @@ private void validateArguments() throws PackagerException { String packageType = deployParams.getTargetFormat(); String ptype = (packageType != null) ? packageType : "default"; - boolean imageOnly = IMAGE_PACKAGE_TYPE.equals(packageType); + boolean imageOnly = (packageType == null); boolean hasAppImage = allOptions.contains( CLIOptions.PREDEFINED_APP_IMAGE); boolean hasRuntime = allOptions.contains( @@ -694,10 +683,6 @@ deployParams.setClasspath(); } - static boolean isCLIOption(String arg) { - return toCLIOption(arg) != null; - } - static CLIOptions toCLIOption(String arg) { CLIOptions option; if ((option = argIds.get(arg)) == null) { --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BasicBundlers.java 2019-06-23 08:54:45.328144000 -0400 +++ new/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BasicBundlers.java 2019-06-23 08:54:43.097301100 -0400 @@ -75,11 +75,6 @@ } } - @Override - public void loadDefaultBundlers() { - // no-op. We now load all bundlers from module system. - } - // Loads bundlers from the META-INF/services direct @Override public void loadBundlersFromServices(ClassLoader cl) { @@ -88,9 +83,4 @@ bundlers.add(aLoader); } } - - @Override - public void loadBundler(Bundler bundler) { - bundlers.add(bundler); - } } --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java 2019-06-23 08:54:56.843165600 -0400 +++ new/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java 2019-06-23 08:54:54.737125100 -0400 @@ -70,10 +70,6 @@ return valueType; } - void setValueType(Class valueType) { - this.valueType = valueType; - } - boolean getIsDefaultValue() { return isDefaultValue; } @@ -82,21 +78,11 @@ return defaultValueFunction; } - void setDefaultValueFunction( - Function, T> defaultValueFunction) { - this.defaultValueFunction = defaultValueFunction; - } - BiFunction,T> getStringConverter() { return stringConverter; } - void setStringConverter(BiFunction, T> stringConverter) { - this.stringConverter = stringConverter; - } - @SuppressWarnings("unchecked") final T fetchFrom(Map params) { return fetchFrom(params, true); --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundlers.java 2019-06-23 08:55:08.777395100 -0400 +++ new/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundlers.java 2019-06-23 08:55:06.733755800 -0400 @@ -101,30 +101,6 @@ Collection getBundlers(String type); /** - * Loads the bundlers common to the JDK. A typical implementation - * would load: - *
    - *
  • Windows file image
  • - *
  • Mac .app
  • - *
  • Linux file image
  • - - *
  • Windows MSI
  • - *
  • Windows EXE
  • - *
  • Mac DMG
  • - *
  • Mac PKG
  • - *
  • Linux DEB
  • - *
  • Linux RPM
  • - * - *
- * - * This method is called from the - * {@link #createBundlersInstance(ClassLoader)} - * and {@link #createBundlersInstance()} methods. - * NOTE: Because of the module system this method is now not used. - */ - void loadDefaultBundlers(); - - /** * Loads bundlers from the META-INF/services directly. * * This method is called from the @@ -133,11 +109,4 @@ */ void loadBundlersFromServices(ClassLoader cl); - /** - * Loads a specific bundler into the set of bundlers. - * Useful for a manually configured bundler. - * - * @param bundler the specific bundler to add - */ - void loadBundler(Bundler bundler); } --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java 2019-06-23 08:55:21.995849700 -0400 +++ new/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java 2019-06-23 08:55:20.092613100 -0400 @@ -121,31 +121,6 @@ }); } - public static void copyFromURL(URL location, File file) throws IOException { - copyFromURL(location, file, false); - } - - public static void copyFromURL(URL location, File file, boolean append) - throws IOException { - if (location == null) { - throw new IOException("Missing input resource!"); - } - if (file.exists() && !append) { - file.delete(); - } - try (InputStream in = location.openStream(); - FileOutputStream out = new FileOutputStream(file, append)) { - - byte[] buffer = new byte[1024]; - int len; - while ((len = in.read(buffer)) != -1) { - out.write(buffer, 0, len); - } - } - file.setReadOnly(); - file.setReadable(true, false); - } - public static void copyFile(File sourceFile, File destFile) throws IOException { destFile.getParentFile().mkdirs(); --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java 2019-06-23 08:55:34.866097200 -0400 +++ new/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java 2019-06-23 08:55:32.884859100 -0400 @@ -67,36 +67,6 @@ static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink").orElseThrow(); - private JLinkBundlerHelper() {} - - static String listOfPathToString(List value) { - String result = ""; - - for (Path path : value) { - if (result.length() > 0) { - result += File.pathSeparator; - } - - result += path.toString(); - } - - return result; - } - - static String setOfStringToString(Set value) { - String result = ""; - - for (String element : value) { - if (result.length() > 0) { - result += ","; - } - - result += element; - } - - return result; - } - static File getMainJar(Map params) { File result = null; RelativeFileSet fileset = --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ModuleManager.java 2019-06-23 08:55:46.488320700 -0400 +++ new/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ModuleManager.java 2019-06-23 08:55:44.429081100 -0400 @@ -62,12 +62,6 @@ } } - List getModules() { - return getModules(EnumSet.of(SearchType.UnnamedJar, - SearchType.ModularJar, SearchType.Jmod, - SearchType.ExplodedModule)); - } - List getModules(EnumSet Search) { List result = new ArrayList(); --- old/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java 2019-06-23 08:55:59.858777900 -0400 +++ new/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java 2019-06-23 08:55:57.893140100 -0400 @@ -147,44 +147,11 @@ Files.createDirectories(runtimeDir); } - private Path destFile(String dir, String filename) { - return runtimeDir.resolve(dir).resolve(filename); - } - private void writeEntry(InputStream in, Path dstFile) throws IOException { Files.createDirectories(dstFile.getParent()); Files.copy(in, dstFile); } - private void writeSymEntry(Path dstFile, Path target) throws IOException { - Files.createDirectories(dstFile.getParent()); - Files.createLink(dstFile, target); - } - - /** - * chmod ugo+x file - */ - private void setExecutable(Path file) { - try { - Set perms = - Files.getPosixFilePermissions(file); - perms.add(PosixFilePermission.OWNER_EXECUTE); - perms.add(PosixFilePermission.GROUP_EXECUTE); - perms.add(PosixFilePermission.OTHERS_EXECUTE); - Files.setPosixFilePermissions(file, perms); - } catch (IOException ioe) { - throw new UncheckedIOException(ioe); - } - } - - private static void createUtf8File(File file, String content) - throws IOException { - try (OutputStream fout = new FileOutputStream(file); - Writer output = new OutputStreamWriter(fout, "UTF-8")) { - output.write(content); - } - } - public static String getLauncherName(Map params) { return APP_NAME.fetchFrom(params) + ".exe"; } @@ -286,25 +253,6 @@ } } - private boolean copyMSVCDLLs(String VS_VER) throws IOException { - final InputStream REDIST_MSVCR_URL = getResourceAsStream( - REDIST_MSVCR.replaceAll("VS_VER", VS_VER)); - final InputStream REDIST_MSVCP_URL = getResourceAsStream( - REDIST_MSVCP.replaceAll("VS_VER", VS_VER)); - - if (REDIST_MSVCR_URL != null && REDIST_MSVCP_URL != null) { - Files.copy( - REDIST_MSVCR_URL, - binDir.resolve(REDIST_MSVCR.replaceAll("VS_VER", VS_VER))); - Files.copy( - REDIST_MSVCP_URL, - binDir.resolve(REDIST_MSVCP.replaceAll("VS_VER", VS_VER))); - return true; - } - - return false; - } - private void validateValueAndPut( Map data, String key, BundlerParamInfo param, --- old/src/jdk.jpackage/share/classes/jdk/jpackage/internal/InvalidBundlerParamException.java 2019-06-23 08:56:11.324998400 -0400 +++ /dev/null 2019-06-23 08:56:12.000000000 -0400 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2014, 2019, 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.jpackage.internal; - -public class InvalidBundlerParamException extends RuntimeException { - private static final long serialVersionUID = 1L; - public InvalidBundlerParamException(String message) { - super(message); - } -} --- old/test/jdk/tools/jpackage/JPackageInvalidArgTest.java 2019-06-23 08:56:18.625938800 -0400 +++ new/test/jdk/tools/jpackage/JPackageInvalidArgTest.java 2019-06-23 08:56:16.395095900 -0400 @@ -36,7 +36,7 @@ private static final String ARG2 = "--output"; private static final String RESULT1 = "Invalid Option: [--no-such-argument]"; - private static final String RESULT2 = "Missing argument:"; + private static final String RESULT2 = "--main-jar or --module"; private static void validate(String arg, String output) throws Exception { String[] result = JPackageHelper.splitAndFilter(output); --- old/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageErrorTest.java 2019-06-23 08:56:31.451385600 -0400 +++ new/test/jdk/tools/jpackage/createappimage/JPackageCreateAppImageErrorTest.java 2019-06-23 08:56:29.251743300 -0400 @@ -45,7 +45,7 @@ private static final String EXPECTED1 = "Invalid Option: [--no-such-argument]"; private static final String ARG2 = "--output"; - private static final String EXPECTED2 = "Missing argument:"; + private static final String EXPECTED2 = "--main-jar or --module"; private static final String [] CMD1 = { "--input", "input",