[java-identity-provider] branch master updated: IDP-1619 Remove use of suspect variable names.

Rod Widdowson rdw at steadingsoftware.com
Tue Jun 9 15:18:47 UTC 2020


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=e45d65ac05d1b29b6dfe0a23518c31cc1b487096

The following commit(s) were added to refs/heads/master by this push:
       new  e45d65ac0 IDP-1619 Remove use of suspect variable names.
e45d65ac0 is described below

commit e45d65ac05d1b29b6dfe0a23518c31cc1b487096
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Jun 9 16:16:28 2020 +0100

    IDP-1619 Remove use of suspect variable names.
    
    idp-installer:
    https://issues.shibboleth.net/jira/browse/IDP-1619
---
 .../net/shibboleth/idp/installer/PropertiesWithComments.java   | 10 +++++-----
 .../src/main/java/net/shibboleth/idp/installer/V4Install.java  |  6 +++---
 .../shibboleth/idp/installer/TestPropertiesWithComments.java   |  4 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/PropertiesWithComments.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/PropertiesWithComments.java
index ee6febc4c..f393adf8e 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/PropertiesWithComments.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/PropertiesWithComments.java
@@ -60,7 +60,7 @@ public final class PropertiesWithComments {
     private final Properties nameReplacement;
 
     /**  BlackListed property names. */
-    @Nonnull private final Set<String> blacklistedNames;
+    @Nonnull private final Set<String> unreplacableNames;
 
     /** Have we loaded data?.
      *
@@ -74,10 +74,10 @@ public final class PropertiesWithComments {
     }
 
     /** Constructor.
-     * @param blacklist names to warn on.
+     * @param unreplacable names to warn on.
      */
-    public PropertiesWithComments(@Nonnull final Set<String> blacklist) {
-        blacklistedNames = Set.copyOf(blacklist);
+    public PropertiesWithComments(@Nonnull final Set<String> unreplacable) {
+        unreplacableNames = Set.copyOf(unreplacable);
         nameReplacement = new Properties();
     }
 
@@ -232,7 +232,7 @@ public final class PropertiesWithComments {
      */
     public boolean replaceProperty(final String propName, final String newPropValue) {
 
-        Constraint.isFalse(blacklistedNames.contains(propName),
+        Constraint.isFalse(unreplacableNames.contains(propName),
                 "property '" + propName + "' cannot be replaced");
         CommentedProperty p = properties.get(propName);
         if (null != p) {
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java
index 52ab96351..fb73a4b22 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java
@@ -206,7 +206,7 @@ public class V4Install extends AbstractInitializableComponent {
      */
     // CheckStyle: CyclomaticComplexity|MethodLength OFF
     protected void populatePropertyFiles(final boolean sealerCreated) throws BuildException {
-        final Set<String> blackList = Set.of(
+        final Set<String> doNotReplaceList = Set.of(
                 "idp.sealer.storePassword",
                 "idp.sealer.keyPassword",
                 "idp.authn.LDAP.bindDNCredential",
@@ -227,7 +227,7 @@ public class V4Install extends AbstractInitializableComponent {
                 if (!Files.exists(source)) {
                     throw new BuildException("missing idp.properties in dist");
                 }
-                final PropertiesWithComments propertiesToReWrite = new PropertiesWithComments(blackList);
+                final PropertiesWithComments propertiesToReWrite = new PropertiesWithComments(doNotReplaceList);
                 final Properties replacements;
                 if (mergePath != null) {
                     log.debug("Creating {} from {} and {}", target, source, mergePath);
@@ -268,7 +268,7 @@ public class V4Install extends AbstractInitializableComponent {
                     throw new BuildException("missing ldap.properties in dist");
                 }
                 log.debug("Creating {} from {} and {}", target, source, ldapMergePath);
-                final PropertiesWithComments propertiesToReWrite = new PropertiesWithComments(blackList);
+                final PropertiesWithComments propertiesToReWrite = new PropertiesWithComments(doNotReplaceList);
                 final Properties replacements = new Properties();
                 final File mergeFile = ldapMergePath.toFile();
                 if (!installerProps.isNoTidy()) {
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/TestPropertiesWithComments.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/TestPropertiesWithComments.java
index 8cc3133bc..8c8612483 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/TestPropertiesWithComments.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/TestPropertiesWithComments.java
@@ -85,7 +85,7 @@ public class TestPropertiesWithComments {
         
     }
 
-    @Test public void testBlackList() throws IOException {
+    @Test public void testUnreplaceableList() throws IOException {
         final PropertiesWithComments pwc = new PropertiesWithComments(Set.of("x", "a", "b"));
 
         pwc.load(getInputStream());
@@ -93,7 +93,7 @@ public class TestPropertiesWithComments {
         pwc.replaceProperty("c", "new C");
         try {
             pwc.replaceProperty("a", "new C");
-            fail("Property Replacement with black listed name worked");
+            fail("Property Replacement with unreplaceable name worked");
         } catch (ConstraintViolationException e) {
             // OK
         }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list