Fix String comparisona (#21752)

Closes #21773
This commit is contained in:
ali_dandach 2023-07-21 11:37:24 +03:00 committed by GitHub
parent 897965f604
commit ef19e08814
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View file

@ -68,7 +68,7 @@ public abstract class AbstractKeycloakAuthenticatorValve extends FormAuthenticat
cache = false; cache = false;
} else if (Lifecycle.AFTER_START_EVENT.equals(event.getType())) { } else if (Lifecycle.AFTER_START_EVENT.equals(event.getType())) {
keycloakInit(); keycloakInit();
} else if (event.getType() == Lifecycle.BEFORE_STOP_EVENT) { } else if (Lifecycle.BEFORE_STOP_EVENT.equals(event.getType())) {
beforeStop(); beforeStop();
} }
} }

View file

@ -3,6 +3,7 @@ package org.keycloak.representations.docker;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* JSON Representation of a Docker Error in the following format: * JSON Representation of a Docker Error in the following format:
@ -60,7 +61,7 @@ public class DockerError {
final DockerError that = (DockerError) o; final DockerError that = (DockerError) o;
if (errorCode != that.errorCode) return false; if (!Objects.equals(errorCode, that.errorCode)) return false;
if (message != null ? !message.equals(that.message) : that.message != null) return false; if (message != null ? !message.equals(that.message) : that.message != null) return false;
return dockerErrorDetails != null ? dockerErrorDetails.equals(that.dockerErrorDetails) : that.dockerErrorDetails == null; return dockerErrorDetails != null ? dockerErrorDetails.equals(that.dockerErrorDetails) : that.dockerErrorDetails == null;
} }

View file

@ -27,6 +27,7 @@ import jakarta.persistence.NamedQueries;
import jakarta.persistence.NamedQuery; import jakarta.persistence.NamedQuery;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
/** /**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a> * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
@ -120,7 +121,7 @@ public class FederatedUserRequiredActionEntity {
Key key = (Key) o; Key key = (Key) o;
if (action != key.action) return false; if (!Objects.equals(action, key.action)) return false;
if (userId != null ? !userId.equals(key.userId != null ? key.userId : null) : key.userId != null) return false; if (userId != null ? !userId.equals(key.userId != null ? key.userId : null) : key.userId != null) return false;
return true; return true;
@ -142,7 +143,7 @@ public class FederatedUserRequiredActionEntity {
FederatedUserRequiredActionEntity key = (FederatedUserRequiredActionEntity) o; FederatedUserRequiredActionEntity key = (FederatedUserRequiredActionEntity) o;
if (action != key.action) return false; if (!Objects.equals(action, key.action)) return false;
if (userId != null ? !userId.equals(key.userId != null ? key.userId : null) : key.userId != null) return false; if (userId != null ? !userId.equals(key.userId != null ? key.userId : null) : key.userId != null) return false;
return true; return true;

View file

@ -517,7 +517,7 @@ public class CertificateValidator {
logger.debugf("Certificate policies found: %s", String.join(",", policyList)); logger.debugf("Certificate policies found: %s", String.join(",", policyList));
if (policyCheckMode == CERTIFICATE_POLICY_MODE_ANY) if (CERTIFICATE_POLICY_MODE_ANY.equals(policyCheckMode))
{ {
boolean hasMatch = expectedPolicies.stream().anyMatch(p -> policyList.contains(p.toLowerCase())); boolean hasMatch = expectedPolicies.stream().anyMatch(p -> policyList.contains(p.toLowerCase()));
if (!hasMatch) { if (!hasMatch) {