8264334: Use the blessed modifier order in jdk.jpackage

Reviewed-by: herrick, shade
This commit is contained in:
Alex Blewitt 2021-03-29 08:01:42 +00:00 committed by Aleksey Shipilev
parent 8ee9a05d37
commit 30b4b17ccb
19 changed files with 58 additions and 58 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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 {

View File

@ -56,7 +56,7 @@ abstract class LinuxPackageBundler extends AbstractBundler {
}
@Override
final public boolean validate(Map<String, ? super Object> params)
public final boolean validate(Map<String, ? super Object> 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<String, ? super Object> params,
public final Path execute(Map<String, ? super Object> params,
Path outputParentDir) throws PackagerException {
IOUtils.writableOutputDir(outputParentDir);
@ -233,28 +233,28 @@ abstract class LinuxPackageBundler extends AbstractBundler {
return data;
}
abstract protected List<ConfigException> verifyOutputBundle(
protected abstract List<ConfigException> verifyOutputBundle(
Map<String, ? super Object> params, Path packageBundle);
abstract protected void initLibProvidersLookup(
protected abstract void initLibProvidersLookup(
Map<String, ? super Object> params,
LibProvidersLookup libProvidersLookup);
abstract protected List<ToolValidator> getToolValidators(
protected abstract List<ToolValidator> getToolValidators(
Map<String, ? super Object> params);
abstract protected void doValidate(Map<String, ? super Object> params)
protected abstract void doValidate(Map<String, ? super Object> params)
throws ConfigException;
abstract protected Map<String, String> createReplacementData(
protected abstract Map<String, String> createReplacementData(
Map<String, ? super Object> params) throws IOException;
abstract protected Path buildPackageBundle(
protected abstract Path buildPackageBundle(
Map<String, String> replacementData,
Map<String, ? super Object> params, Path outputParentDir) throws
PackagerException, IOException;
final protected PlatformPackage createMetaPackage(
protected final PlatformPackage createMetaPackage(
Map<String, ? super Object> params) {
Supplier<ApplicationLayout> packageLayout = () -> {

View File

@ -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() {

View File

@ -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 {

View File

@ -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<String, ? super Object> params)
public final boolean validate(Map<String, ? super Object> params)
throws ConfigException {
try {
Objects.requireNonNull(params);
@ -81,7 +81,7 @@ class AppImageBundler extends AbstractBundler {
}
@Override
final public Path execute(Map<String, ? super Object> params,
public final Path execute(Map<String, ? super Object> 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;
}

View File

@ -55,9 +55,9 @@ public class AppImageFile {
private final String launcherName;
private final List<String> addLauncherNames;
private final static String FILENAME = ".jpackage.xml";
private static final String FILENAME = ".jpackage.xml";
private final static Map<Platform, String> PLATFORM_LABELS = Map.of(
private static final Map<Platform, String> PLATFORM_LABELS = Map.of(
Platform.LINUX, "linux", Platform.WINDOWS, "windows", Platform.MAC,
"macOS");

View File

@ -31,7 +31,7 @@ import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME;
public class BundleParams {
final protected Map<String, ? super Object> params;
protected final Map<String, ? super Object> params;
/**
* create a new bundle with all default values

View File

@ -144,5 +144,5 @@ final class CfgFile {
List<String> javaOptions;
private final ApplicationLayout appLayout;
private final static Object SECTION_TAG = new Object();
private static final Object SECTION_TAG = new Object();
}

View File

@ -160,9 +160,9 @@ final class DottedVersion implements Comparable<String> {
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+");
}

View File

@ -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;

View File

@ -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(

View File

@ -57,9 +57,9 @@ import java.util.stream.Stream;
class StandardBundlerParam<T> extends BundlerParamInfo<T> {
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",

View File

@ -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() {

View File

@ -832,29 +832,29 @@ class WixAppImageFragmentBuilder extends WixFragmentBuilder {
private Map<Path, Integer> removeFolderItems;
private Set<String> 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<Path> ROOT_DIRS = Set.of(INSTALLDIR, TARGETDIR);
private static final Set<Path> 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<Path> SYSTEM_DIRS = Set.of(TARGETDIR,
private static final Set<Path> SYSTEM_DIRS = Set.of(TARGETDIR,
PROGRAM_MENU_PATH, DESKTOP_PATH, PROGRAM_FILES, LOCAL_PROGRAM_FILES);
private final static Set<Path> KNOWN_DIRS = Stream.of(Set.of(INSTALLDIR),
private static final Set<Path> KNOWN_DIRS = Stream.of(Set.of(INSTALLDIR),
SYSTEM_DIRS).flatMap(Set::stream).collect(
Collectors.toUnmodifiableSet());
private final static Set<Path> USER_PROFILE_DIRS = Set.of(LOCAL_PROGRAM_FILES,
private static final Set<Path> USER_PROFILE_DIRS = Set.of(LOCAL_PROGRAM_FILES,
PROGRAM_MENU_PATH, DESKTOP_PATH);
private static final StandardBundlerParam<String> MENU_GROUP =

View File

@ -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<String, String> variables;
}

View File

@ -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

View File

@ -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);