return invokeCustom(proxy, method, args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre);
/** * This method is a default implementation for the invoke method given in * Invocationhandler. Any call to a method with a declaring class that is * not Object, excluding toString(), is redirected to invokeCustom. * Methods like equals and hashcode are called on the class itself instead * of the delegate because they are considered fundamental methods that should * not be overwritten. The toString() method gets special treatment as it is * deemed to be a method that you might wish to override when called from Groovy. * * In many scenarios, it is better to overwrite the invokeCustom method where * the core Object related methods are filtered out. * * @param proxy the proxy * @param method the method * @param args the arguments * @return the result of the invocation by method or delegate * @throws Throwable if caused by the delegate or the method * @see #invokeCustom(Object, Method, Object[]) * @see InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (!isCoreObjectMethod(method)) { return invokeCustom(proxy, method, args); } try { return method.invoke(this, args); } catch (InvocationTargetException ite) { throw ite.getTargetException(); } }
/** * This method is a default implementation for the invoke method given in * Invocationhandler. Any call to a method with a declaring class that is * not Object, excluding toString(), is redirected to invokeCustom. * Methods like equals and hashcode are called on the class itself instead * of the delegate because they are considered fundamental methods that should * not be overwritten. The toString() method gets special treatment as it is * deemed to be a method that you might wish to override when called from Groovy. * * In many scenarios, it is better to overwrite the invokeCustom method where * the core Object related methods are filtered out. * * @param proxy the proxy * @param method the method * @param args the arguments * @return the result of the invocation by method or delegate * @throws Throwable if caused by the delegate or the method * @see #invokeCustom(Object, Method, Object[]) * @see InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (!isCoreObjectMethod(method)) { return invokeCustom(proxy, method, args); } try { return method.invoke(this, args); } catch (InvocationTargetException ite) { throw ite.getTargetException(); } }
/** * This method is a default implementation for the invoke method given in * Invocationhandler. Any call to a method with a declaring class that is * not Object, excluding toString(), is redirected to invokeCustom. * Methods like equals and hashcode are called on the class itself instead * of the delegate because they are considered fundamental methods that should * not be overwritten. The toString() method gets special treatment as it is * deemed to be a method that you might wish to override when called from Groovy. * * In many scenarios, it is better to overwrite the invokeCustom method where * the core Object related methods are filtered out. * * @param proxy the proxy * @param method the method * @param args the arguments * @return the result of the invocation by method or delegate * @throws Throwable if caused by the delegate or the method * @see #invokeCustom(Object, Method, Object[]) * @see InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (!checkMethod(method)) { return invokeCustom(proxy, method, args); } try { return method.invoke(this, args); } catch (InvocationTargetException ite) { throw ite.getTargetException(); } }
if (!checkMethod(method)) { try { return invokeCustom(proxy, method, args); } catch (GroovyRuntimeException gre) { throw ScriptBytecodeAdapter.unwrap(gre);