1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Reduce Diff Size

This commit reorders the originally changed boolean logic so that it returns
false early, as it did before. This allows the change to remain small and also
keeps the most complex logical statements outside of the if statement.

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
This commit is contained in:
Josh Cummings
2026-02-12 17:08:19 -07:00
parent 329d9e2dfd
commit 410812c5bc
@@ -44,10 +44,10 @@ public abstract class AbstractValidatingPasswordEncoder implements PasswordEncod
@Override
public final boolean matches(@Nullable CharSequence rawPassword, @Nullable String encodedPassword) {
if (StringUtils.hasLength(rawPassword) && StringUtils.hasLength(encodedPassword)) {
return matchesNonNull(rawPassword.toString(), encodedPassword);
if (!StringUtils.hasLength(rawPassword) || !StringUtils.hasLength(encodedPassword)) {
return false;
}
return false;
return matchesNonNull(rawPassword.toString(), encodedPassword);
}
protected abstract boolean matchesNonNull(String rawPassword, String encodedPassword);