8170599: compiler/** tests using ToolProvider.getSystemClassLoader failing
authoralanb
Thu, 01 Dec 2016 15:54:39 +0000
changeset 42309 21f9f3fbc302
parent 42308 45166b2aac44
child 42310 bb4ec5bdb5d8
8170599: compiler/** tests using ToolProvider.getSystemClassLoader failing Reviewed-by: hseigel
hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java
--- a/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java	Thu Dec 01 11:16:11 2016 +0000
+++ b/hotspot/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java	Thu Dec 01 15:54:39 2016 +0000
@@ -30,6 +30,7 @@
  *          java.compiler
  *          java.instrument
  *          java.management
+ *          jdk.attach
  *
  * @run main/othervm compiler.jsr292.RedefineMethodUsedByMultipleMethodHandles
  */
@@ -42,7 +43,6 @@
 import jdk.internal.org.objectweb.asm.MethodVisitor;
 import jdk.internal.org.objectweb.asm.Opcodes;
 
-import javax.tools.ToolProvider;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -132,7 +132,7 @@
         int p = vmName.indexOf('@');
         assert p != -1 : "VM name not in <pid>@<host> format: " + vmName;
         String pid = vmName.substring(0, p);
-        ClassLoader cl = ToolProvider.getSystemToolClassLoader();
+        ClassLoader cl = ClassLoader.getSystemClassLoader();
         Class<?> c = Class.forName("com.sun.tools.attach.VirtualMachine", true, cl);
         Method attach = c.getDeclaredMethod("attach", String.class);
         Method loadAgent = c.getDeclaredMethod("loadAgent", String.class);
--- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java	Thu Dec 01 11:16:11 2016 +0000
+++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java	Thu Dec 01 15:54:39 2016 +0000
@@ -27,6 +27,7 @@
  * @library ../../../../../
  * @modules jdk.vm.ci/jdk.vm.ci.meta
  *          jdk.vm.ci/jdk.vm.ci.runtime
+ *          jdk.attach
  *          java.base/jdk.internal.misc
  * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.RedefineClassTest
  */
@@ -37,7 +38,6 @@
 import org.junit.Assert;
 import org.junit.Test;
 
-import javax.tools.ToolProvider;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -137,7 +137,7 @@
         int p = vmName.indexOf('@');
         assumeTrue(p != -1);
         String pid = vmName.substring(0, p);
-        ClassLoader cl = ToolProvider.getSystemToolClassLoader();
+        ClassLoader cl = ClassLoader.getSystemClassLoader();
         Class<?> c = Class.forName("com.sun.tools.attach.VirtualMachine", true, cl);
         Method attach = c.getDeclaredMethod("attach", String.class);
         Method loadAgent = c.getDeclaredMethod("loadAgent", String.class, String.class);