Use instanceof Pattern Matching

This commit is contained in:
Hyeon Sung 2024-05-15 02:15:18 +09:00 committed by Marcus Hert Da Coregio
parent 6ec81b1aec
commit 742c95b1fc
1 changed files with 2 additions and 2 deletions

View File

@ -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();
}
}