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:
+3
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user