6725221: Standardize obtaining boolean properties with defaults

Reviewed-by: prr, rriggs
This commit is contained in:
Mark Powers 2022-05-24 18:16:07 +00:00 committed by Bradford Wetmore
parent 194bc08a89
commit 6cc4bb1169
3 changed files with 8 additions and 8 deletions

View File

@ -34,7 +34,7 @@ import java.util.HashSet;
import static java.util.zip.ZipConstants64.*; import static java.util.zip.ZipConstants64.*;
import static java.util.zip.ZipUtils.*; import static java.util.zip.ZipUtils.*;
import sun.nio.cs.UTF_8; import sun.nio.cs.UTF_8;
import sun.security.action.GetPropertyAction; import sun.security.action.GetBooleanAction;
/** /**
* This class implements an output stream filter for writing files in the * This class implements an output stream filter for writing files in the
@ -55,8 +55,7 @@ public class ZipOutputStream extends DeflaterOutputStream implements ZipConstant
* some in jdk7. * some in jdk7.
*/ */
private static final boolean inhibitZip64 = private static final boolean inhibitZip64 =
Boolean.parseBoolean( GetBooleanAction.privilegedGetProperty("jdk.util.zip.inhibitZip64");
GetPropertyAction.privilegedGetProperty("jdk.util.zip.inhibitZip64"));
private static class XEntry { private static class XEntry {
final ZipEntry entry; final ZipEntry entry;

View File

@ -33,6 +33,7 @@ import java.util.Locale;
import java.util.ServiceConfigurationError; import java.util.ServiceConfigurationError;
import java.util.ServiceLoader; import java.util.ServiceLoader;
import sun.security.util.SecurityConstants; import sun.security.util.SecurityConstants;
import sun.security.action.GetBooleanAction;
import sun.security.action.GetPropertyAction; import sun.security.action.GetPropertyAction;
/** /**
@ -95,8 +96,8 @@ public final class LoggerFinderLoader {
// Whether multiple provider should be considered as an error. // Whether multiple provider should be considered as an error.
// This is further submitted to the configuration error policy. // This is further submitted to the configuration error policy.
private static boolean ensureSingletonProvider() { private static boolean ensureSingletonProvider() {
return Boolean.parseBoolean( return GetBooleanAction.privilegedGetProperty
GetPropertyAction.privilegedGetProperty("jdk.logger.finder.singleton")); ("jdk.logger.finder.singleton");
} }
@SuppressWarnings("removal") @SuppressWarnings("removal")

View File

@ -31,7 +31,7 @@ import java.util.*;
import java.security.*; import java.security.*;
import jdk.internal.util.StaticProperty; import jdk.internal.util.StaticProperty;
import sun.security.action.GetPropertyAction; import sun.security.action.GetBooleanAction;
import sun.security.util.SecurityProviderConstants; import sun.security.util.SecurityProviderConstants;
import static sun.security.util.SecurityProviderConstants.getAliases; import static sun.security.util.SecurityProviderConstants.getAliases;
@ -320,8 +320,8 @@ public final class SunEntries {
private static final String PROP_RNDSOURCE = "securerandom.source"; private static final String PROP_RNDSOURCE = "securerandom.source";
private static final boolean useLegacyDSA = private static final boolean useLegacyDSA =
Boolean.parseBoolean(GetPropertyAction.privilegedGetProperty GetBooleanAction.privilegedGetProperty
("jdk.security.legacyDSAKeyPairGenerator")); ("jdk.security.legacyDSAKeyPairGenerator");
static final String URL_DEV_RANDOM = "file:/dev/random"; static final String URL_DEV_RANDOM = "file:/dev/random";
static final String URL_DEV_URANDOM = "file:/dev/urandom"; static final String URL_DEV_URANDOM = "file:/dev/urandom";