diff options
Diffstat (limited to 'libjava/testsuite/libjava.loader/TestLeak.java')
-rw-r--r-- | libjava/testsuite/libjava.loader/TestLeak.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libjava/testsuite/libjava.loader/TestLeak.java b/libjava/testsuite/libjava.loader/TestLeak.java new file mode 100644 index 0000000..9d467f2 --- /dev/null +++ b/libjava/testsuite/libjava.loader/TestLeak.java @@ -0,0 +1,33 @@ +import java.net.*; +import java.lang.reflect.*; + +public class TestLeak +{ + class MyLoader extends URLClassLoader + { + 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 (); + } + } +} + + |