Skip to content

Commit 742c95b

Browse files
dukbongmarcusdacoregio
authored andcommitted
Use instanceof Pattern Matching
1 parent 6ec81b1 commit 742c95b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/java/org/springframework/security/authentication/AbstractAuthenticationToken.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ public void eraseCredentials() {
112112
}
113113

114114
private void eraseSecret(Object secret) {
115-
if (secret instanceof CredentialsContainer) {
116-
((CredentialsContainer) secret).eraseCredentials();
115+
if (secret instanceof CredentialsContainer container) {
116+
container.eraseCredentials();
117117
}
118118
}
119119

0 commit comments

Comments
 (0)