Skip to content

Commit

Permalink
rename method arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiang Zhong committed Jun 3, 2022
1 parent 21c7c74 commit 1c7bf6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
*******************************************************************************/
package com.intuit.ipp.query;

import java.lang.reflect.Method;
import java.util.Calendar;
import java.util.Date;

import com.intuit.ipp.data.Customer;
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import net.bytebuddy.implementation.MethodDelegation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ public MyMethodInterceptor() {
}

@RuntimeType
public Object intercept(@This Object arg0, @Origin Method arg1, @AllArguments Object[] arg2, @SuperMethod(nullIfImpossible = true) Method arg3) throws FMSException {
public Object intercept(@This Object proxyObject, @Origin Method method, @AllArguments Object[] methodArgs, @SuperMethod(nullIfImpossible = true) Method superMethod) throws FMSException {

if (GenerateQuery.path.get() == null) {
GenerateQuery.path.set(new Path<Object>(extractPropertyName(arg1), extractEntity(arg0)));
GenerateQuery.path.set(new Path<Object>(extractPropertyName(method), extractEntity(proxyObject)));
} else {
String parentPath = GenerateQuery.path.get().getPathString();
GenerateQuery.path.get().setPathString(parentPath.concat(".").concat(extractPropertyName(arg1)));
GenerateQuery.path.get().setPathString(parentPath.concat(".").concat(extractPropertyName(method)));
}
return createInstance(arg0, arg1, arg2, arg3);
return createInstance(proxyObject, method, methodArgs, superMethod);
}

/**
Expand Down Expand Up @@ -101,15 +101,15 @@ protected String extractPropertyName(Method method) {
/**
* create the object for linked method call or object of leaf node
*
* @param type
* @param
* @return
* @throws Throwable
*/
@SuppressWarnings("unchecked")
public <T> T createInstance(Object arg0, Method arg1, Object[] arg2, Method arg3)
public <T> T createInstance(Object proxyObject, Method method, Object[] methodArgs, Method superMethod)
throws FMSException {
Object obj = null;
Class<?> type = arg1.getReturnType();
Class<?> type = method.getReturnType();
if (String.class.equals(type)) {
obj = null;
} else if (Integer.class.equals(type) || int.class.equals(type)) {
Expand Down Expand Up @@ -140,10 +140,10 @@ public <T> T createInstance(Object arg0, Method arg1, Object[] arg2, Method arg3
obj = Boolean.TRUE;
} else if (List.class.isAssignableFrom(type)) {
try {
Type t = arg1.getGenericReturnType();
Type t = method.getGenericReturnType();
Object value = getObject(t);
Object queryValue = GenerateQuery.createQueryEntity(value);
obj = arg3.invoke(arg0, arg2);
obj = superMethod.invoke(proxyObject, methodArgs);
((List<Object>) obj).add(queryValue);
} catch (Throwable t) {
throw new FMSException(t);
Expand Down

0 comments on commit 1c7bf6c

Please sign in to comment.