Skip to content

Commit

Permalink
Use instanceof Pattern Matching
Browse files Browse the repository at this point in the history
  • Loading branch information
dukbong authored and marcusdacoregio committed May 15, 2024
1 parent 6ec81b1 commit 742c95b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public void eraseCredentials() {
}

private void eraseSecret(Object secret) {
if (secret instanceof CredentialsContainer) {
((CredentialsContainer) secret).eraseCredentials();
if (secret instanceof CredentialsContainer container) {
container.eraseCredentials();
}
}

Expand Down

0 comments on commit 742c95b

Please sign in to comment.