Skip to content

Commit

Permalink
8340276: Test java/lang/management/ThreadMXBean/Locks.java failed wit…
Browse files Browse the repository at this point in the history
…h NullPointerException

Reviewed-by: cjplummer, lmesnik
  • Loading branch information
kevinjwalls committed Sep 19, 2024
1 parent 6719899 commit c58fbef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/jdk/java/lang/management/ThreadMXBean/Locks.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, 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
Expand Down Expand Up @@ -422,6 +422,9 @@ private static ThreadInfo findOwnerInfo(ThreadInfo[] infos, String lock)
lock + " expected to have owner");
}
for (ThreadInfo info1 : infos) {
if (info1 == null) {
continue; // Missing thread, e.g. completed. Ignore.
}
if (info1.getThreadId() == threadId) {
ownerInfo = info1;
break;
Expand Down

0 comments on commit c58fbef

Please sign in to comment.