From 30b4b17ccb5cc1ad8e6da529b12573cea2b46e2a Mon Sep 17 00:00:00 2001 From: Alex Blewitt Date: Mon, 29 Mar 2021 08:01:42 +0000 Subject: [PATCH] 8264334: Use the blessed modifier order in jdk.jpackage Reviewed-by: herrick, shade --- .../jpackage/internal/LibProvidersLookup.java | 2 +- .../internal/LinuxAppImageBuilder.java | 2 +- .../jpackage/internal/LinuxDebBundler.java | 8 ++++---- .../internal/LinuxPackageBundler.java | 20 +++++++++---------- .../jpackage/internal/LinuxRpmBundler.java | 8 ++++---- .../jdk/jpackage/internal/MacDmgBundler.java | 2 +- .../jpackage/internal/AppImageBundler.java | 14 ++++++------- .../jdk/jpackage/internal/AppImageFile.java | 4 ++-- .../jdk/jpackage/internal/BundleParams.java | 2 +- .../jdk/jpackage/internal/CfgFile.java | 2 +- .../jdk/jpackage/internal/DottedVersion.java | 6 +++--- .../jdk/jpackage/internal/Executor.java | 4 ++-- .../jpackage/internal/JLinkBundlerHelper.java | 4 ++-- .../internal/StandardBundlerParam.java | 6 +++--- .../jdk/jpackage/internal/WinExeBundler.java | 2 +- .../internal/WixAppImageFragmentBuilder.java | 20 +++++++++---------- .../jdk/jpackage/internal/WixPipeline.java | 2 +- .../jdk/jpackage/internal/WixTool.java | 2 +- .../internal/WixUiFragmentBuilder.java | 6 +++--- 19 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LibProvidersLookup.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LibProvidersLookup.java index 0d6188c87ad..55200b908cd 100644 --- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LibProvidersLookup.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LibProvidersLookup.java @@ -43,7 +43,7 @@ import java.util.stream.Stream; /** * Builds list of packages providing dynamic libraries for the given set of files. */ -final public class LibProvidersLookup { +public final class LibProvidersLookup { static boolean supported() { return (new ToolValidator(TOOL_LDD).validate() == null); } diff --git a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java index 4cd6376f786..a12ed59c10e 100644 --- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java @@ -54,7 +54,7 @@ public class LinuxAppImageBuilder extends AbstractAppImageBuilder { }, (s, p) -> Path.of(s)); - final static String DEFAULT_ICON = "JavaApp.png"; + static final String DEFAULT_ICON = "JavaApp.png"; LinuxAppImageBuilder(Path imageOutDir) { super(imageOutDir); diff --git a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java index 6d79c433662..d4ac854bf15 100644 --- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java @@ -91,11 +91,11 @@ public class LinuxDebBundler extends LinuxPackageBundler { return s; }); - private final static String TOOL_DPKG_DEB = "dpkg-deb"; - private final static String TOOL_DPKG = "dpkg"; - private final static String TOOL_FAKEROOT = "fakeroot"; + private static final String TOOL_DPKG_DEB = "dpkg-deb"; + private static final String TOOL_DPKG = "dpkg"; + private static final String TOOL_FAKEROOT = "fakeroot"; - private final static String DEB_ARCH; + private static final String DEB_ARCH; static { String debArch; try { diff --git a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxPackageBundler.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxPackageBundler.java index 788abe46876..ce327cd2743 100644 --- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxPackageBundler.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxPackageBundler.java @@ -56,7 +56,7 @@ abstract class LinuxPackageBundler extends AbstractBundler { } @Override - final public boolean validate(Map params) + public final boolean validate(Map params) throws ConfigException { // run basic validation to ensure requirements are met @@ -106,12 +106,12 @@ abstract class LinuxPackageBundler extends AbstractBundler { } @Override - final public String getBundleType() { + public final String getBundleType() { return "INSTALLER"; } @Override - final public Path execute(Map params, + public final Path execute(Map params, Path outputParentDir) throws PackagerException { IOUtils.writableOutputDir(outputParentDir); @@ -233,28 +233,28 @@ abstract class LinuxPackageBundler extends AbstractBundler { return data; } - abstract protected List verifyOutputBundle( + protected abstract List verifyOutputBundle( Map params, Path packageBundle); - abstract protected void initLibProvidersLookup( + protected abstract void initLibProvidersLookup( Map params, LibProvidersLookup libProvidersLookup); - abstract protected List getToolValidators( + protected abstract List getToolValidators( Map params); - abstract protected void doValidate(Map params) + protected abstract void doValidate(Map params) throws ConfigException; - abstract protected Map createReplacementData( + protected abstract Map createReplacementData( Map params) throws IOException; - abstract protected Path buildPackageBundle( + protected abstract Path buildPackageBundle( Map replacementData, Map params, Path outputParentDir) throws PackagerException, IOException; - final protected PlatformPackage createMetaPackage( + protected final PlatformPackage createMetaPackage( Map params) { Supplier packageLayout = () -> { diff --git a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java index 43b30bd0e1e..cd742a4f9a7 100644 --- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java @@ -110,11 +110,11 @@ public class LinuxRpmBundler extends LinuxPackageBundler { params -> null, (s, p) -> s); - private final static String DEFAULT_SPEC_TEMPLATE = "template.spec"; + private static final String DEFAULT_SPEC_TEMPLATE = "template.spec"; - public final static String TOOL_RPM = "rpm"; - public final static String TOOL_RPMBUILD = "rpmbuild"; - public final static DottedVersion TOOL_RPMBUILD_MIN_VERSION = DottedVersion.lazy( + public static final String TOOL_RPM = "rpm"; + public static final String TOOL_RPMBUILD = "rpmbuild"; + public static final DottedVersion TOOL_RPMBUILD_MIN_VERSION = DottedVersion.lazy( "4.10"); public LinuxRpmBundler() { diff --git a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java index e93bc276d1b..a1dae495d93 100644 --- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java @@ -572,7 +572,7 @@ public class MacDmgBundler extends MacBaseInstallerBundler { return isSupported(); } - public final static String[] required = + public static final String[] required = {"/usr/bin/hdiutil", "/usr/bin/osascript"}; public static boolean isSupported() { try { diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageBundler.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageBundler.java index 5ee569c94e4..3f73b83fb16 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageBundler.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageBundler.java @@ -41,22 +41,22 @@ import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; class AppImageBundler extends AbstractBundler { @Override - final public String getName() { + public final String getName() { return I18N.getString("app.bundler.name"); } @Override - final public String getID() { + public final String getID() { return "app"; } @Override - final public String getBundleType() { + public final String getBundleType() { return "IMAGE"; } @Override - final public boolean validate(Map params) + public final boolean validate(Map params) throws ConfigException { try { Objects.requireNonNull(params); @@ -81,7 +81,7 @@ class AppImageBundler extends AbstractBundler { } @Override - final public Path execute(Map params, + public final Path execute(Map params, Path outputParentDir) throws PackagerException { if (StandardBundlerParam.isRuntimeInstaller(params)) { return PREDEFINED_RUNTIME_IMAGE.fetchFrom(params); @@ -98,12 +98,12 @@ class AppImageBundler extends AbstractBundler { } @Override - final public boolean supported(boolean runtimeInstaller) { + public final boolean supported(boolean runtimeInstaller) { return true; } @Override - final public boolean isDefault() { + public final boolean isDefault() { return false; } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageFile.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageFile.java index 4de06e14038..dd1993f179c 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageFile.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageFile.java @@ -55,9 +55,9 @@ public class AppImageFile { private final String launcherName; private final List addLauncherNames; - private final static String FILENAME = ".jpackage.xml"; + private static final String FILENAME = ".jpackage.xml"; - private final static Map PLATFORM_LABELS = Map.of( + private static final Map PLATFORM_LABELS = Map.of( Platform.LINUX, "linux", Platform.WINDOWS, "windows", Platform.MAC, "macOS"); diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java index 453d6963be2..a33d596973b 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java @@ -31,7 +31,7 @@ import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; public class BundleParams { - final protected Map params; + protected final Map params; /** * create a new bundle with all default values diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CfgFile.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CfgFile.java index b5320ed941b..1a97fb2614f 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CfgFile.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CfgFile.java @@ -144,5 +144,5 @@ final class CfgFile { List javaOptions; private final ApplicationLayout appLayout; - private final static Object SECTION_TAG = new Object(); + private static final Object SECTION_TAG = new Object(); } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DottedVersion.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DottedVersion.java index 2e9152af88c..61b285f4756 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DottedVersion.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DottedVersion.java @@ -160,9 +160,9 @@ final class DottedVersion implements Comparable { return components; } - final private BigInteger[] components; - final private String value; - final private boolean greedy; + private final BigInteger[] components; + private final String value; + private final boolean greedy; private static final Pattern DIGITS = Pattern.compile("\\d+"); } diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java index 5b04fec1232..b6689b4f7f2 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java @@ -36,7 +36,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; -final public class Executor { +public final class Executor { Executor() { } @@ -223,7 +223,7 @@ final public class Executor { return sb.toString(); } - public final static int INFINITE_TIMEOUT = -1; + public static final int INFINITE_TIMEOUT = -1; private ProcessBuilder pb; private boolean saveOutput; diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java index 343c469f931..6b4def12811 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java @@ -213,10 +213,10 @@ final class JLinkBundlerHelper { } // The token for "all modules on the module path". - private final static String ALL_MODULE_PATH = "ALL-MODULE-PATH"; + private static final String ALL_MODULE_PATH = "ALL-MODULE-PATH"; // The token for "all valid runtime modules". - private final static String ALL_DEFAULT = "ALL-DEFAULT"; + private static final String ALL_DEFAULT = "ALL-DEFAULT"; private static class LazyLoad { static final ToolProvider JLINK_TOOL = ToolProvider.findFirst( diff --git a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java index 8da3d8847f7..edf6e368fd4 100644 --- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java @@ -57,9 +57,9 @@ import java.util.stream.Stream; class StandardBundlerParam extends BundlerParamInfo { private static final String JAVABASEJMOD = "java.base.jmod"; - private final static String DEFAULT_VERSION = "1.0"; - private final static String DEFAULT_RELEASE = "1"; - private final static String[] DEFAULT_JLINK_OPTIONS = { + private static final String DEFAULT_VERSION = "1.0"; + private static final String DEFAULT_RELEASE = "1"; + private static final String[] DEFAULT_JLINK_OPTIONS = { "--strip-native-commands", "--strip-debug", "--no-man-pages", diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java index 59662df38a1..c8aae592287 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java @@ -54,7 +54,7 @@ public class WinExeBundler extends AbstractBundler { }, (s, p) -> null); - private final static String EXE_WRAPPER_NAME = "msiwrapper.exe"; + private static final String EXE_WRAPPER_NAME = "msiwrapper.exe"; @Override public String getName() { diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixAppImageFragmentBuilder.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixAppImageFragmentBuilder.java index 7fa52c49447..ac926232144 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixAppImageFragmentBuilder.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixAppImageFragmentBuilder.java @@ -832,29 +832,29 @@ class WixAppImageFragmentBuilder extends WixFragmentBuilder { private Map removeFolderItems; private Set defaultedMimes; - private final static Path TARGETDIR = Path.of("TARGETDIR"); + private static final Path TARGETDIR = Path.of("TARGETDIR"); - private final static Path INSTALLDIR = Path.of("INSTALLDIR"); + private static final Path INSTALLDIR = Path.of("INSTALLDIR"); - private final static Set ROOT_DIRS = Set.of(INSTALLDIR, TARGETDIR); + private static final Set ROOT_DIRS = Set.of(INSTALLDIR, TARGETDIR); - private final static Path PROGRAM_MENU_PATH = TARGETDIR.resolve("ProgramMenuFolder"); + private static final Path PROGRAM_MENU_PATH = TARGETDIR.resolve("ProgramMenuFolder"); - private final static Path DESKTOP_PATH = TARGETDIR.resolve("DesktopFolder"); + private static final Path DESKTOP_PATH = TARGETDIR.resolve("DesktopFolder"); - private final static Path PROGRAM_FILES = TARGETDIR.resolve( + private static final Path PROGRAM_FILES = TARGETDIR.resolve( is64Bit() ? "ProgramFiles64Folder" : "ProgramFilesFolder"); - private final static Path LOCAL_PROGRAM_FILES = TARGETDIR.resolve("LocalAppDataFolder"); + private static final Path LOCAL_PROGRAM_FILES = TARGETDIR.resolve("LocalAppDataFolder"); - private final static Set SYSTEM_DIRS = Set.of(TARGETDIR, + private static final Set SYSTEM_DIRS = Set.of(TARGETDIR, PROGRAM_MENU_PATH, DESKTOP_PATH, PROGRAM_FILES, LOCAL_PROGRAM_FILES); - private final static Set KNOWN_DIRS = Stream.of(Set.of(INSTALLDIR), + private static final Set KNOWN_DIRS = Stream.of(Set.of(INSTALLDIR), SYSTEM_DIRS).flatMap(Set::stream).collect( Collectors.toUnmodifiableSet()); - private final static Set USER_PROFILE_DIRS = Set.of(LOCAL_PROGRAM_FILES, + private static final Set USER_PROFILE_DIRS = Set.of(LOCAL_PROGRAM_FILES, PROGRAM_MENU_PATH, DESKTOP_PATH); private static final StandardBundlerParam MENU_GROUP = diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixPipeline.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixPipeline.java index 19f319ed9c2..58a07b6cbaf 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixPipeline.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixPipeline.java @@ -135,7 +135,7 @@ public class WixPipeline { workDir != null ? workDir.toFile() : null)).executeExpectSuccess(); } - private final static class WixSource { + private static final class WixSource { Path source; Map variables; } diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixTool.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixTool.java index 1db2400e975..68104444b3c 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixTool.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixTool.java @@ -123,7 +123,7 @@ public enum WixTool { })::validate; } - private final static DottedVersion MINIMAL_VERSION = DottedVersion.lazy("3.0"); + private static final DottedVersion MINIMAL_VERSION = DottedVersion.lazy("3.0"); static Path getSystemDir(String envVar, String knownDir) { return Optional diff --git a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixUiFragmentBuilder.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixUiFragmentBuilder.java index d2522593283..2a5821fbfd4 100644 --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixUiFragmentBuilder.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixUiFragmentBuilder.java @@ -327,7 +327,7 @@ final class WixUiFragmentBuilder extends WixFragmentBuilder { private final String id; } - private final static class DialogPair { + private static final class DialogPair { DialogPair(Dialog first, Dialog second) { this(first.id, second.id); @@ -375,7 +375,7 @@ final class WixUiFragmentBuilder extends WixFragmentBuilder { private final String secondId; } - private final static class Publish { + private static final class Publish { Publish(String control, String condition, int order) { this.control = control; @@ -388,7 +388,7 @@ final class WixUiFragmentBuilder extends WixFragmentBuilder { private final int order; } - private final static class PublishBuilder { + private static final class PublishBuilder { PublishBuilder() { order(0);