Use instanceof Pattern Matching
This commit is contained in:
parent
6ec81b1aec
commit
742c95b1fc
|
@ -112,8 +112,8 @@ public abstract class AbstractAuthenticationToken implements Authentication, Cre
|
|||
}
|
||||
|
||||
private void eraseSecret(Object secret) {
|
||||
if (secret instanceof CredentialsContainer) {
|
||||
((CredentialsContainer) secret).eraseCredentials();
|
||||
if (secret instanceof CredentialsContainer container) {
|
||||
container.eraseCredentials();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue