Skip to content

Commit d2e0439

Browse files
Backport c58fbef05eace85a2e429da1ac8ff1ae09a0b736
1 parent f55ff01 commit d2e0439

File tree

1 file changed

+4
-1
lines changed
  • test/jdk/java/lang/management/ThreadMXBean

1 file changed

+4
-1
lines changed

test/jdk/java/lang/management/ThreadMXBean/Locks.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -422,6 +422,9 @@ private static ThreadInfo findOwnerInfo(ThreadInfo[] infos, String lock)
422422
lock + " expected to have owner");
423423
}
424424
for (ThreadInfo info1 : infos) {
425+
if (info1 == null) {
426+
continue; // Missing thread, e.g. completed. Ignore.
427+
}
425428
if (info1.getThreadId() == threadId) {
426429
ownerInfo = info1;
427430
break;

0 commit comments

Comments
 (0)