diff -r 8bd166b4c145 -r 384728911193 hotspot/test/compiler/codegen/6823354/Test6823354.java --- a/hotspot/test/compiler/codegen/6823354/Test6823354.java Thu Oct 15 11:20:04 2015 +0000 +++ b/hotspot/test/compiler/codegen/6823354/Test6823354.java Thu Oct 15 18:00:00 2015 +0300 @@ -1,5 +1,5 @@ /* - * 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 @@ -25,11 +25,11 @@ * @test * @bug 6823354 * @summary These methods can be instrinsified by using bit scan, bit test, and population count instructions. - * + * @library /testlibrary * @run main/othervm -Xcomp -XX:CompileOnly=Test6823354.lzcomp,Test6823354.tzcomp,.dolzcomp,.dotzcomp Test6823354 */ -import java.net.URLClassLoader; +import jdk.test.lib.Utils; public class Test6823354 { // Arrays of corner case values. @@ -197,8 +197,9 @@ 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();