diff --git a/auth/client/src/main/java/org/wildfly/security/auth/client/ElytronXmlParser.java b/auth/client/src/main/java/org/wildfly/security/auth/client/ElytronXmlParser.java index 0a9702d1c87..2268b276428 100644 --- a/auth/client/src/main/java/org/wildfly/security/auth/client/ElytronXmlParser.java +++ b/auth/client/src/main/java/org/wildfly/security/auth/client/ElytronXmlParser.java @@ -714,13 +714,10 @@ private static void parseCertificateRevocationLists(ConfigurationXMLStreamReader while (reader.hasNext()) { final int tag = reader.nextTag(); if (tag == START_ELEMENT) { - switch (reader.getLocalName()) { - case "certificate-revocation-list": { - parseCertificateRevocationList(reader, builder, xmlVersion, true); - break; - } - default: - throw reader.unexpectedElement(); + if (reader.getLocalName().equals("certificate-revocation-list")) { + parseCertificateRevocationList(reader, builder, xmlVersion, true); + } else { + throw reader.unexpectedElement(); } } else if (tag != END_ELEMENT) { throw reader.unexpectedContent(); diff --git a/auth/realm/base/src/main/java/org/wildfly/security/auth/realm/FileSystemSecurityRealm.java b/auth/realm/base/src/main/java/org/wildfly/security/auth/realm/FileSystemSecurityRealm.java index 6ef7cc4cc9a..2b04bf1ca19 100644 --- a/auth/realm/base/src/main/java/org/wildfly/security/auth/realm/FileSystemSecurityRealm.java +++ b/auth/realm/base/src/main/java/org/wildfly/security/auth/realm/FileSystemSecurityRealm.java @@ -1000,7 +1000,7 @@ private Void replaceIdentityPrivileged(final LoadedIdentity newIdentity) throws } } - private Version requiredVersion(final LoadedIdentity identityToWrite) { + private Version requiredVersion() { // As new functionality is added we will identify if we need to use a later version // if new functionality is used then use the required schema version otherwise fallback // to an older version. @@ -1018,7 +1018,7 @@ private void writeIdentity(final XMLStreamWriter streamWriter, final LoadedIdent streamWriter.writeStartDocument(); streamWriter.writeCharacters("\n"); streamWriter.writeStartElement("identity"); - streamWriter.writeDefaultNamespace(requiredVersion(newIdentity).getNamespace()); + streamWriter.writeDefaultNamespace(requiredVersion().getNamespace()); if (integrityEnabled) { streamWriter.writeCharacters("\n "); @@ -1099,6 +1099,7 @@ private void writeIdentity(final XMLStreamWriter streamWriter, final LoadedIdent streamWriter.writeEndDocument(); } + @Override public void dispose() { // Release the lock for this realm identity IdentityLock identityLock = lock; diff --git a/auth/realm/ldap/src/main/java/org/wildfly/security/auth/realm/ldap/X509EvidenceVerifier.java b/auth/realm/ldap/src/main/java/org/wildfly/security/auth/realm/ldap/X509EvidenceVerifier.java index 8b2bd7bd61a..b764ee60f50 100644 --- a/auth/realm/ldap/src/main/java/org/wildfly/security/auth/realm/ldap/X509EvidenceVerifier.java +++ b/auth/realm/ldap/src/main/java/org/wildfly/security/auth/realm/ldap/X509EvidenceVerifier.java @@ -176,10 +176,8 @@ public boolean verifyCertificate(X509Certificate certificate, Attributes attribu for (int i = 0; i < size; i++) { Object attrDigest = attribute.get(i); - if (attrDigest != null){ - if (digest.equalsIgnoreCase((String) attrDigest)) { - return true; - } + if (attrDigest != null && digest.equalsIgnoreCase((String) attrDigest)){ + return true; } } } catch (NoSuchAlgorithmException | CertificateEncodingException e) { diff --git a/tool/src/main/java/org/wildfly/security/tool/CredentialStoreCommand.java b/tool/src/main/java/org/wildfly/security/tool/CredentialStoreCommand.java index 62b2637a773..493d5df134c 100644 --- a/tool/src/main/java/org/wildfly/security/tool/CredentialStoreCommand.java +++ b/tool/src/main/java/org/wildfly/security/tool/CredentialStoreCommand.java @@ -92,8 +92,8 @@ */ class CredentialStoreCommand extends Command { - public static int ACTION_NOT_DEFINED = 5; - public static int ALIAS_NOT_FOUND = 6; + public static final int ACTION_NOT_DEFINED = 5; + public static final int ALIAS_NOT_FOUND = 6; public static final String RSA_ALGORITHM = "RSA"; public static final String DSA_ALGORITHM = "DSA"; diff --git a/tool/src/main/java/org/wildfly/security/tool/ElytronTool.java b/tool/src/main/java/org/wildfly/security/tool/ElytronTool.java index 0d0d4193a10..2cae692d978 100644 --- a/tool/src/main/java/org/wildfly/security/tool/ElytronTool.java +++ b/tool/src/main/java/org/wildfly/security/tool/ElytronTool.java @@ -36,11 +36,11 @@ public class ElytronTool { /** * status code for unrecognized command */ - public static int ElytronToolExitStatus_unrecognizedCommand = 1; + public static final int ElytronToolExitStatus_unrecognizedCommand = 1; /** * status code for no problems */ - public static int ElytronToolExitStatus_OK = 0; + public static final int ElytronToolExitStatus_OK = 0; private Map commandRegistry = new HashMap<>(); /** diff --git a/tool/src/main/java/org/wildfly/security/tool/VaultCommand.java b/tool/src/main/java/org/wildfly/security/tool/VaultCommand.java index 11181c5fd57..edf7fb18acb 100644 --- a/tool/src/main/java/org/wildfly/security/tool/VaultCommand.java +++ b/tool/src/main/java/org/wildfly/security/tool/VaultCommand.java @@ -446,7 +446,7 @@ private void printSummary (String keystorePassword, String salt, int iterationCo if (keystorePassword != null) { password = keystorePassword; if (salt != null && iterationCount > -1) { - password = keystorePassword.startsWith(MASK_PREFIX) ? keystorePassword + ";" + salt + ";" + String.valueOf(iterationCount) + password = keystorePassword.startsWith(MASK_PREFIX) ? keystorePassword + ";" + salt + ";" + iterationCount : MaskCommand.computeMasked(keystorePassword, salt, iterationCount); } }