2002-11-04 02:31:12 +01:00
|
|
|
import java.net.*;
|
2007-01-09 20:58:05 +01:00
|
|
|
import java.lang.reflect.Proxy;
|
2002-11-04 02:31:12 +01:00
|
|
|
|
|
|
|
public class TestLeak
|
|
|
|
{
|
2007-01-09 20:58:05 +01:00
|
|
|
static class MyLoader extends URLClassLoader
|
2002-11-04 02:31:12 +01:00
|
|
|
{
|
|
|
|
public MyLoader (URL urls[])
|
|
|
|
{
|
|
|
|
super (urls);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void main (String[] args)
|
|
|
|
{
|
|
|
|
URLClassLoader ucl =
|
|
|
|
(URLClassLoader) ClassLoader.getSystemClassLoader();
|
|
|
|
URL urls[] = ucl.getURLs ();
|
|
|
|
Class ifaces[] = new Class[1];
|
|
|
|
ifaces[0] = java.lang.Comparable.class;
|
|
|
|
|
|
|
|
try {
|
|
|
|
for (int i = 0; i < 100; i++)
|
|
|
|
{
|
|
|
|
Proxy.getProxyClass (new MyLoader (urls), ifaces);
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|