Polish 'Use pattern matching with cast'

See gh-42076
This commit is contained in:
Phillip Webb
2024-09-01 19:01:19 -07:00
parent 7cb1671871
commit 2c012ed092

View File

@@ -365,9 +365,8 @@ public class BomExtension {
}
public Object methodMissing(String name, Object args) {
if (args instanceof Object[] objects && objects.length == 1) {
Object arg = objects[0];
if (arg instanceof Closure<?> closure) {
if (args instanceof Object[] argsArray && argsArray.length == 1) {
if (argsArray[0] instanceof Closure<?> closure) {
ModuleHandler moduleHandler = new ModuleHandler();
closure.setResolveStrategy(Closure.DELEGATE_FIRST);
closure.setDelegate(moduleHandler);