gcc/libjava/testsuite/libjava.lang/TestProxy.java
Tom Tromey ab711ed3c2 ExtraClassLoader.out: New file.
* testsuite/libjava.lang/ExtraClassLoader.out: New file.
	* testsuite/libjava.lang/TestProxy.java (MyInvocationHandler):
	Now static.

From-SVN: r105185
2005-10-10 19:18:26 +00:00

35 lines
693 B
Java

import java.lang.reflect.*;
import java.net.*;
public class TestProxy
{
public static class MyInvocationHandler implements InvocationHandler
{
public Object invoke (Object proxy,
Method method,
Object[] args)
throws Throwable
{
System.out.println (args[0]);
return null;
}
}
public static void main (String[] args)
{
try {
InvocationHandler ih = new MyInvocationHandler();
SocketOptions c = (SocketOptions)
Proxy.newProxyInstance (SocketOptions.class.getClassLoader(),
new Class[]{SocketOptions.class},
ih);
c.getOption (555);
} catch (Exception e) {
e.printStackTrace ();
}
}
}