CachedClass[] paramTypes = method.getParameterTypes();
if (paramTypes.length == 0)
return;
NewInstanceMetaMethod metaMethod;
if (paramTypes[0].isAssignableFrom(self.getTheClass())) {
if (paramTypes[0].getTheClass() == self.getTheClass())
metaMethod = new NewInstanceMetaMethod(method);
else
metaMethod = new NewInstanceMetaMethod(method) {
public CachedClass getDeclaringClass() {
return ReflectionCache.getCachedClass(self.getTheClass());
}
};
arr.add(metaMethod);
} else {
if (self.getTheClass().isAssignableFrom(paramTypes[0].getTheClass())) {
metaMethod = new NewInstanceMetaMethod(method);
arr.add(metaMethod);
}
}
}