diff --git a/spring-vault-core/src/main/java/org/springframework/vault/core/env/LeaseAwareVaultPropertySource.java b/spring-vault-core/src/main/java/org/springframework/vault/core/env/LeaseAwareVaultPropertySource.java index 6b9a1050f..23ccce367 100644 --- a/spring-vault-core/src/main/java/org/springframework/vault/core/env/LeaseAwareVaultPropertySource.java +++ b/spring-vault-core/src/main/java/org/springframework/vault/core/env/LeaseAwareVaultPropertySource.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -221,7 +222,7 @@ public String[] getPropertyNames() { */ protected void handleLeaseEvent(SecretLeaseEvent leaseEvent, Map properties) { - if (leaseEvent.getSource() != getRequestedSecret()) { + if (!Objects.equals(leaseEvent.getSource(), getRequestedSecret())) { return; } @@ -259,7 +260,7 @@ protected void handleLeaseEvent(SecretLeaseEvent leaseEvent, Map */ protected void handleLeaseErrorEvent(SecretLeaseEvent leaseEvent, Exception exception) { - if (leaseEvent.getSource() != getRequestedSecret()) { + if (!Objects.equals(leaseEvent.getSource(), getRequestedSecret())) { return; }