From 32b37a6764bedee2face628279f5fff4656a9c57 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Wed, 19 Oct 2022 13:25:34 -0400 Subject: [PATCH] update --- .../internal/security/SecurityRestrictConfigurator.java | 6 +++--- .../internal/security/SecurityRestrictProperties.java | 2 +- src/java.base/share/classes/java/security/Provider.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/closed/src/java.base/share/classes/openj9/internal/security/SecurityRestrictConfigurator.java b/closed/src/java.base/share/classes/openj9/internal/security/SecurityRestrictConfigurator.java index f750d63afbc..dda7769b738 100644 --- a/closed/src/java.base/share/classes/openj9/internal/security/SecurityRestrictConfigurator.java +++ b/closed/src/java.base/share/classes/openj9/internal/security/SecurityRestrictConfigurator.java @@ -178,7 +178,7 @@ public static boolean configureSecurityRestrict(Properties props) { private static void initUserSecuritySetting() { if (debug != null) { - debug.println("Load user security restrict settings."); + debug.println("Loading user security restrict settings."); } String[] inputs = userSecuritySetting.split(","); @@ -245,7 +245,7 @@ private static void setSecurityRestrictProviders(Properties props, ArrayList propsMapping = new HashMap<>(); @@ -268,7 +268,7 @@ private static void setSecurityRestrictProperties(Properties props, SecurityRest props.setProperty(jdkPropsName, notNullEmpty(propsOldValue) ? propsOldValue + ", " + propsNewValue : propsNewValue); if (debug != null) { - debug.println("Add security restrict properties, with property: " + jdkPropsName + " values: " + debug.println("Added security restrict properties, with property: " + jdkPropsName + " values: " + (notNullEmpty(propsOldValue) ? propsOldValue + ", " + propsNewValue : propsNewValue)); } } diff --git a/closed/src/java.base/share/classes/openj9/internal/security/SecurityRestrictProperties.java b/closed/src/java.base/share/classes/openj9/internal/security/SecurityRestrictProperties.java index 37edab6ac9b..c00c001f0b5 100644 --- a/closed/src/java.base/share/classes/openj9/internal/security/SecurityRestrictProperties.java +++ b/closed/src/java.base/share/classes/openj9/internal/security/SecurityRestrictProperties.java @@ -265,7 +265,7 @@ private void initSecurityRestrictProperties() { .getProperty("SecurityRestrict" + userSecurityNum + ".securerandom.algorithm").trim(); if (debug != null) { - debug.println("Loaded Security Restrict properties."); + debug.println("Loaded security restrict properties."); } } diff --git a/src/java.base/share/classes/java/security/Provider.java b/src/java.base/share/classes/java/security/Provider.java index 171298fb6eb..0bd7816f295 100644 --- a/src/java.base/share/classes/java/security/Provider.java +++ b/src/java.base/share/classes/java/security/Provider.java @@ -1381,14 +1381,14 @@ protected void putService(Service s) { throw new IllegalArgumentException ("service.getProvider() must match this Provider object"); } - String type = s.getType(); - String algorithm = s.getAlgorithm(); if (SecurityRestrictConfigurator.enableSecurityRestrict()) { // If security restrict is not allow, then return without register if (!SecurityRestrictProperties.getInstance().isConstraintsAllow(s)) { return; } } + String type = s.getType(); + String algorithm = s.getAlgorithm(); ServiceKey key = new ServiceKey(type, algorithm, true); implRemoveService(serviceMap.get(key)); serviceMap.put(key, s);