< prev index next >

test/compiler/c2/5057225/Test5057225.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -23,15 +23,15 @@
 
 /**
  * @test
  * @bug 5057225
  * @summary Remove useless I2L conversions
- *
+ * @library /testlibrary
  * @run main/othervm -Xcomp -XX:CompileOnly=Test5057225.doload Test5057225
  */
 
-import java.net.URLClassLoader;
+import jdk.test.lib.Utils;
 
 public class Test5057225 {
     static byte[]  ba = new byte[]  { -1 };
     static short[] sa = new short[] { -1 };
     static int[]   ia = new int[]   { -1 };

@@ -87,12 +87,13 @@
             throw new InternalError(result + " != " + expected);
     }
 
     static void loadAndRunClass(String classname) throws Exception {
         Class cl = Class.forName(classname);
-        URLClassLoader apploader = (URLClassLoader) cl.getClassLoader();
-        ClassLoader loader = new URLClassLoader(apploader.getURLs(), apploader.getParent());
+        ClassLoader apploader = cl.getClassLoader();
+        ClassLoader loader
+                = Utils.getTestClassPathURLClassLoader(apploader.getParent());
         Class c = loader.loadClass(classname);
         Runnable r = (Runnable) c.newInstance();
         r.run();
     }
 
< prev index next >