in the method intercept of CGLib proxy:
public Object intercept(Object arg0, Method arg1, Object[] arg2, MethodProxy arg3) throws Throwable {
// TODO Auto-generated method stub
Performance performance = new Performance();
performance.begin(arg0.getClass().getName() + "." + arg1.getName());
Object result = arg3.invokeSuper(arg0, arg2);//or just arg3.invokeSuper(arg0, arg2); and return null
performance.end();
return result;
}
and in the method invoke of JDK proxy
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
// TODO Auto-generated method stub
Performance performance = new Performance();
performance.begin(target.getClass().getName() + ":" + method.getName());
Object obj = method.invoke(target, args);//or just method.invoke(target, args); and return null
performance.end();
return obj;
}
but when I return null,nothing changed.So why these methods need a return value?