use of org.codehaus.groovy.runtime.metaclass.TransformMetaMethod in project groovy-core by groovy.
the class MetaClassImpl method tryListParamMetaMethod.
private MetaMethod tryListParamMetaMethod(Class sender, String methodName, boolean isCallToSuper, Object[] arguments) {
MetaMethod method = null;
if (arguments.length == 1 && arguments[0] instanceof List) {
Object[] newArguments = ((List) arguments[0]).toArray();
method = getMethodWithCaching(sender, methodName, newArguments, isCallToSuper);
if (method != null) {
method = new TransformMetaMethod(method) {
public Object invoke(Object object, Object[] arguments) {
Object firstArgument = arguments[0];
List list = (List) firstArgument;
arguments = list.toArray();
return super.invoke(object, arguments);
}
};
}
}
return method;
}
use of org.codehaus.groovy.runtime.metaclass.TransformMetaMethod in project groovy by apache.
the class MetaClassImpl method tryListParamMetaMethod.
private MetaMethod tryListParamMetaMethod(Class sender, String methodName, boolean isCallToSuper, Object[] arguments) {
MetaMethod method = null;
if (arguments.length == 1 && arguments[0] instanceof List) {
Object[] newArguments = ((List) arguments[0]).toArray();
method = getMethodWithCaching(sender, methodName, newArguments, isCallToSuper);
if (method != null) {
method = new TransformMetaMethod(method) {
public Object invoke(Object object, Object[] arguments) {
Object firstArgument = arguments[0];
List list = (List) firstArgument;
arguments = list.toArray();
return super.invoke(object, arguments);
}
};
}
}
return method;
}
Aggregations