Merge pull request #42076 from ngocnhan-tran1996
* pr/42076: Polish 'Use pattern matching with cast' Use pattern matching with cast Closes gh-42076
This commit is contained in:
@@ -365,9 +365,8 @@ public class BomExtension {
|
||||
}
|
||||
|
||||
public Object methodMissing(String name, Object args) {
|
||||
if (args instanceof Object[] && ((Object[]) args).length == 1) {
|
||||
Object arg = ((Object[]) args)[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);
|
||||
|
||||
Reference in New Issue
Block a user