Skip to content

Commit 7cb1671

Browse files
ngocnhan-tran1996philwebb
authored andcommitted
Use pattern matching with cast
See gh-42076
1 parent 0968429 commit 7cb1671

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/BomExtension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ public void setPlugins(List<String> plugins) {
365365
}
366366

367367
public Object methodMissing(String name, Object args) {
368-
if (args instanceof Object[] && ((Object[]) args).length == 1) {
369-
Object arg = ((Object[]) args)[0];
368+
if (args instanceof Object[] objects && objects.length == 1) {
369+
Object arg = objects[0];
370370
if (arg instanceof Closure<?> closure) {
371371
ModuleHandler moduleHandler = new ModuleHandler();
372372
closure.setResolveStrategy(Closure.DELEGATE_FIRST);

0 commit comments

Comments
 (0)