All pastes #373006 Raw Edit

Untitled

public text v1 · immutable
#373006 ·published 2007-02-26 13:53 UTC
rendered paste body
	public Object invoke(Object proxy, Method m, Object[] args)
			throws Throwable {
		Object result;
		try {
			String methodName = m.getName();

			if (send_to_first.contains(methodName)) {
				return m.invoke(first, args);
			} else if (send_to_second.contains(methodName)) {
				return m.invoke(second, args);
			} else {
				Class[] parameterTypes = m.getParameterTypes();
				Method rm = getClass().getMethod(methodName, parameterTypes);
				return rm.invoke(this, args);
			}
		} catch (InvocationTargetException e) {
			throw e.getTargetException();
		}
	}