Skip to content

Commit

Permalink
Apply instanceof pattern matching in spring-beans
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixDes committed Mar 22, 2024
1 parent 0e7aba4 commit 0a31a83
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ public Constructor<?>[] getPreferredConstructors() {
if (attribute instanceof Constructor<?> constructor) {
return new Constructor<?>[] {constructor};
}
if (attribute instanceof Constructor<?>[]) {
return (Constructor<?>[]) attribute;
if (attribute instanceof Constructor<?>[] constructors) {
return constructors;
}
throw new IllegalArgumentException("Invalid value type for attribute '" +
PREFERRED_CONSTRUCTORS_ATTRIBUTE + "': " + attribute.getClass().getName());
Expand Down

0 comments on commit 0a31a83

Please sign in to comment.