diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java index e7531226d2d..553706e502d 100644 --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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 @@ -52,7 +52,7 @@ public class ClhsdbInspect { System.out.println("Started LingeredApp with pid " + theApp.getPid()); // Run the 'jstack -v' command to get the address of a Method*, - // the oop address of a java.lang.ref.ReferenceQueue$Lock + // the oop address of a LingeredAppWithLock$NestedLock // and the oop address of a java.lang.Class object List cmds = List.of("jstack -v"); @@ -63,8 +63,8 @@ public class ClhsdbInspect { tokensMap.put("(a java.lang.Class for LingeredAppWithLock)", "instance of Oop for java/lang/Class"); tokensMap.put("Method*=", "Type is Method"); - tokensMap.put("(a java.lang.ref.ReferenceQueue$Lock)", - "instance of Oop for java/lang/ref/ReferenceQueue\\$Lock"); + tokensMap.put("(a LingeredAppWithLock$NestedLock)", + "instance of Oop for LingeredAppWithLock\\$NestedLock"); String[] lines = jstackOutput.split("\\R"); diff --git a/test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java b/test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java index 4319d576590..9a51aef75ce 100644 --- a/test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java +++ b/test/hotspot/jtreg/serviceability/sa/LingeredAppWithLock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2026, 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 @@ -27,6 +27,8 @@ import jdk.test.lib.apps.LingeredApp; public class LingeredAppWithLock extends LingeredApp { private static Object lockObj = new Object(); + private static class NestedLock {} + public static void lockMethod(Object lock) { synchronized (lock) { try { @@ -50,12 +52,14 @@ public class LingeredAppWithLock extends LingeredApp { public static void main(String args[]) { Thread classLock1 = new Thread(() -> lockMethod(LingeredAppWithLock.class)); Thread classLock2 = new Thread(() -> lockMethod(LingeredAppWithLock.class)); + Thread nestedClassLock = new Thread(() -> lockMethod(new NestedLock())); Thread objectLock = new Thread(() -> lockMethod(classLock1)); Thread primitiveLock = new Thread(() -> lockMethod(int.class)); Thread objectWait = new Thread(() -> waitMethod()); classLock1.start(); classLock2.start(); + nestedClassLock.start(); objectLock.start(); primitiveLock.start(); objectWait.start(); @@ -65,6 +69,8 @@ public class LingeredAppWithLock extends LingeredApp { classLock1.getState() != Thread.State.TIMED_WAITING) || (classLock2.getState() != Thread.State.BLOCKED && classLock2.getState() != Thread.State.TIMED_WAITING) || + (nestedClassLock.getState() != Thread.State.BLOCKED && + nestedClassLock.getState() != Thread.State.TIMED_WAITING) || (objectLock.getState() != Thread.State.TIMED_WAITING) || (primitiveLock.getState() != Thread.State.TIMED_WAITING) || (objectWait.getState() != Thread.State.TIMED_WAITING)) { diff --git a/test/jdk/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java b/test/jdk/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java index e6afff5b329..014272a8f96 100644 --- a/test/jdk/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java +++ b/test/jdk/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2026, 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 @@ -171,13 +171,9 @@ public class ConcurrentAssociateTest { String lockName; if ("Signal Dispatcher".equals(name)) continue; - if ("Reference Handler".equals(name) - && (lockName = info.getLockName()) != null - && lockName.startsWith("java.lang.ref.Reference$Lock")) + if ("Reference Handler".equals(name)) continue; - if ("Finalizer".equals(name) - && (lockName = info.getLockName()) != null - && lockName.startsWith("java.lang.ref.ReferenceQueue$Lock")) + if ("Finalizer".equals(name)) continue; System.err.print(info); } diff --git a/test/jdk/java/util/concurrent/Phaser/Basic.java b/test/jdk/java/util/concurrent/Phaser/Basic.java index 2ea09dced99..500e106891b 100644 --- a/test/jdk/java/util/concurrent/Phaser/Basic.java +++ b/test/jdk/java/util/concurrent/Phaser/Basic.java @@ -434,11 +434,9 @@ public class Basic { String name = info.getThreadName(); if ("Signal Dispatcher".equals(name)) continue; - if ("Reference Handler".equals(name) - && info.getLockName().startsWith("java.lang.ref.Reference$Lock")) + if ("Reference Handler".equals(name)) continue; - if ("Finalizer".equals(name) - && info.getLockName().startsWith("java.lang.ref.ReferenceQueue$Lock")) + if ("Finalizer".equals(name)) continue; if (name.startsWith("process reaper")) continue; diff --git a/test/micro/org/openjdk/bench/jdk/internal/jrtfs/ImageReaderBenchmark.java b/test/micro/org/openjdk/bench/jdk/internal/jrtfs/ImageReaderBenchmark.java index 1b89b510fae..b6876e66d98 100644 --- a/test/micro/org/openjdk/bench/jdk/internal/jrtfs/ImageReaderBenchmark.java +++ b/test/micro/org/openjdk/bench/jdk/internal/jrtfs/ImageReaderBenchmark.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2025, 2026, 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 @@ -447,7 +447,6 @@ public class ImageReaderBenchmark { "/modules/java.base/jdk/internal/access/JavaLangRefAccess.class", "/modules/java.base/java/lang/ref/ReferenceQueue.class", "/modules/java.base/java/lang/ref/ReferenceQueue$Null.class", - "/modules/java.base/java/lang/ref/ReferenceQueue$Lock.class", "/modules/java.base/jdk/internal/access/JavaLangAccess.class", "/modules/java.base/jdk/internal/util/SystemProps.class", "/modules/java.base/jdk/internal/util/SystemProps$Raw.class", @@ -1073,6 +1072,5 @@ public class ImageReaderBenchmark { "/modules/java.base/java/nio/charset/CoderResult.class", "/modules/java.base/java/util/IdentityHashMap$IdentityHashMapIterator.class", "/modules/java.base/java/util/IdentityHashMap$KeyIterator.class", - "/modules/java.base/java/lang/Shutdown.class", - "/modules/java.base/java/lang/Shutdown$Lock.class"); + "/modules/java.base/java/lang/Shutdown.class"); }