We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f55ff01 commit d2e0439Copy full SHA for d2e0439
test/jdk/java/lang/management/ThreadMXBean/Locks.java
@@ -1,5 +1,5 @@
1
/*
2
- * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* 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)
422
lock + " expected to have owner");
423
}
424
for (ThreadInfo info1 : infos) {
425
+ if (info1 == null) {
426
+ continue; // Missing thread, e.g. completed. Ignore.
427
+ }
428
if (info1.getThreadId() == threadId) {
429
ownerInfo = info1;
430
break;
0 commit comments