mirror of git://gcc.gnu.org/git/gcc.git
25 lines
475 B
Java
25 lines
475 B
Java
import java.lang.reflect.InvocationHandler;
|
|
import java.lang.reflect.Method;
|
|
|
|
public class ReturnInvocationHandler implements InvocationHandler
|
|
{
|
|
private Object obj;
|
|
public ReturnInvocationHandler(Object obj)
|
|
{
|
|
this.obj = obj;
|
|
}
|
|
public Object invoke(Object proxy, Method m, Object[] args) throws Throwable
|
|
{
|
|
Object result;
|
|
try
|
|
{
|
|
result = m.invoke(obj, args);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
throw e;
|
|
}
|
|
return result;
|
|
}
|
|
}
|