aboutsummaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.loader/TestLeak.java
diff options
context:
space:
mode:
authorAnthony Green <green@redhat.com>2002-11-04 01:31:12 +0000
committerAnthony Green <green@gcc.gnu.org>2002-11-04 01:31:12 +0000
commit55376e412851fb852f4b5c72d1da5e12aec0a459 (patch)
tree50932c23d528ff479cc42e794aaeb5732fb4f309 /libjava/testsuite/libjava.loader/TestLeak.java
parentc9fe6f9f39ac5003dd6642d3d708c6818e99223e (diff)
downloadgcc-55376e412851fb852f4b5c72d1da5e12aec0a459.zip
gcc-55376e412851fb852f4b5c72d1da5e12aec0a459.tar.gz
gcc-55376e412851fb852f4b5c72d1da5e12aec0a459.tar.bz2
New files.
From-SVN: r58778
Diffstat (limited to 'libjava/testsuite/libjava.loader/TestLeak.java')
-rw-r--r--libjava/testsuite/libjava.loader/TestLeak.java33
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 ();
+ }
+ }
+}
+
+