MissingMethodException mme = (MissingMethodException) iie.getCause(); throw new MissingMethodExecutionFailed(mme.getMethod(), mme.getClass(), mme.getArguments(),mme.isStatic(),mme); if (methodMissing instanceof ClosureMetaMethod) throw new MissingMethodExecutionFailed(mme.getMethod(), mme.getClass(), mme.getArguments(),mme.isStatic(),mme); else throw mme;
/** * Groovy override to pass things off to the delegate. * @param name The name of the method. * @param args The method arguments. * @return The return value of the method. */ public Object methodMissing(String name, Object args) { try { return InvokerHelper.invokeMethod(getDelegate(), name, args); } catch (MissingMethodException mme) { throw new MissingMethodException(name, getClass(), mme.getArguments()); } }
/** * Groovy override to pass things off to the delegate. * @param name The name of the method. * @param args The method arguments. * @return The return value of the method. */ public Object methodMissing(String name, Object args) { try { return InvokerHelper.invokeMethod(getDelegate(), name, args); } catch (MissingMethodException mme) { throw new MissingMethodException(name, getClass(), mme.getArguments()); } }
@Override protected DynamicInvokeResult invokeOpaqueMethod(MetaClass metaClass, String name, Object[] arguments) { try { try { return DynamicInvokeResult.found(groovyObject.invokeMethod(name, arguments)); } catch (InvokerInvocationException e) { if (e.getCause() instanceof RuntimeException) { throw (RuntimeException) e.getCause(); } throw e; } } catch (MissingMethodException e) { if (!e.getMethod().equals(name) || !Arrays.equals(e.getArguments(), arguments)) { throw e; } // Else, ignore } return DynamicInvokeResult.notFound(); } }
protected DynamicInvokeResult invokeOpaqueMethod(MetaClass metaClass, String name, Object[] arguments) { MetaMethod methodMissingMethod = findMethodMissingMethod(metaClass); if (methodMissingMethod != null) { try { try { return DynamicInvokeResult.found(methodMissingMethod.invoke(bean, new Object[] {name, arguments})); } catch (InvokerInvocationException e) { if (e.getCause() instanceof MissingMethodException) { throw (MissingMethodException) e.getCause(); } throw e; } } catch (MissingMethodException e) { if (!e.getMethod().equals(name) || !Arrays.equals(e.getArguments(), arguments)) { throw e; } // Ignore } } return DynamicInvokeResult.notFound(); } }
private Object invokeMissingMethod(Object instance, String methodName, Object[] arguments, RuntimeException original) { if (methodMissing != null) { try { return methodMissing.invoke(instance, new Object[]{methodName, arguments}); } catch (InvokerInvocationException iie) { if (methodMissing instanceof ClosureMetaMethod && iie.getCause() instanceof MissingMethodException) { MissingMethodException mme = (MissingMethodException) iie.getCause(); throw new MissingMethodExecutionFailed (mme.getMethod(), mme.getClass(), mme.getArguments(),mme.isStatic(),mme); } throw iie; } } else if (original != null) throw original; else throw new MissingMethodExceptionNoStack(methodName, theClass, arguments, false); }
MissingMethodException mme = (MissingMethodException) iie.getCause(); throw new MissingMethodExecutionFailed (mme.getMethod(), mme.getClass(), mme.getArguments(),mme.isStatic(),mme); if (methodMissing instanceof ClosureMetaMethod) throw new MissingMethodExecutionFailed (mme.getMethod(), mme.getClass(), mme.getArguments(),mme.isStatic(),mme); else throw mme;
MissingMethodException mme = (MissingMethodException) iie.getCause(); throw new MissingMethodExecutionFailed (mme.getMethod(), mme.getClass(), mme.getArguments(),mme.isStatic(),mme);
MissingMethodException mme = (MissingMethodException) iie.getCause(); throw new MissingMethodExecutionFailed (mme.getMethod(), mme.getClass(), mme.getArguments(),mme.isStatic(),mme);