< prev index next >

test/hotspot/jtreg/serviceability/jvmti/8036666/GetObjectLockCount.java

Print this page
@@ -1,7 +1,8 @@
  /*
   * Copyright (c) 2014 SAP SE. All rights reserved.
+  * Copyright (c) 2023, 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.

@@ -54,27 +55,27 @@
  import com.sun.jdi.event.VMStartEvent;
  import com.sun.jdi.request.BreakpointRequest;
  import com.sun.jdi.request.ClassPrepareRequest;
  import com.sun.jdi.request.EventRequestManager;
  
+ import jdk.test.lib.Utils;
  
  /*
   * @test GetObjectLockCount.java
   * @bug 8036666
   * @summary verify jvm returns correct lock recursion count
   * @requires vm.jvmti
+  * @library /test/lib
   * @run compile -g RecursiveObjectLock.java
   * @run main/othervm GetObjectLockCount
   * @author axel.siebenborn@sap.com
   */
  
  public class GetObjectLockCount {
  
      public static final String CLASS_NAME  = "RecursiveObjectLock";
      public static final String METHOD_NAME = "breakpoint1";
-     public static final String ARGUMENTS = "";
- 
  
      /**
       * Find a com.sun.jdi.CommandLineLaunch connector
       */
      static LaunchingConnector findLaunchingConnector() {

@@ -117,11 +118,11 @@
  
          Connector.Argument optionsArg = (Connector.Argument)arguments.get("options");
          if (optionsArg == null) {
              throw new Error("Bad launching connector");
          }
-         optionsArg.setValue(ARGUMENTS);
+         optionsArg.setValue(String.join(" ", Utils.getTestJavaOpts()));
          return arguments;
      }
  
      private static void addClassWatch(VirtualMachine vm) {
          EventRequestManager erm = vm.eventRequestManager();
< prev index next >