public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
try {
Method bridge = handler.getClass().getMethod(method.getName(), method.getParameterTypes());
bridge.setAccessible(true);
return bridge.invoke(handler, args);
}
catch (NoSuchMethodException ex) {
return super.invoke(proxy, method, args);
}
catch (InvocationTargetException ex) {
throw ex.getCause();
}
}
|