From e5ee45d56803ac381cf60214e021aa3739226a12 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Fri, 26 Apr 2024 17:20:53 -0600 Subject: [PATCH] Fix Import Error Issue gh-14880 --- .../security/crypto/password/DelegatingPasswordEncoder.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crypto/src/main/java/org/springframework/security/crypto/password/DelegatingPasswordEncoder.java b/crypto/src/main/java/org/springframework/security/crypto/password/DelegatingPasswordEncoder.java index 2ab7f456ca..22711242f2 100644 --- a/crypto/src/main/java/org/springframework/security/crypto/password/DelegatingPasswordEncoder.java +++ b/crypto/src/main/java/org/springframework/security/crypto/password/DelegatingPasswordEncoder.java @@ -19,8 +19,6 @@ package org.springframework.security.crypto.password; import java.util.HashMap; import java.util.Map; -import org.springframework.util.StringUtils; - /** * A password encoder that delegates to another PasswordEncoder based upon a prefixed * identifier. @@ -292,7 +290,7 @@ public class DelegatingPasswordEncoder implements PasswordEncoder { @Override public boolean matches(CharSequence rawPassword, String prefixEncodedPassword) { String id = extractId(prefixEncodedPassword); - if (StringUtils.hasText(id)) { + if (id != null && !id.isEmpty()) { throw new IllegalArgumentException(String.format(NO_PASSWORD_ENCODER_MAPPED, id)); } throw new IllegalArgumentException(NO_PASSWORD_ENCODER_PREFIX);