Skip to content

Commit

Permalink
Merge pull request #19725 from pshipton/lockinfo
Browse files Browse the repository at this point in the history
Avoid NPE in testThreadMXBeanProxy debug output
  • Loading branch information
keithc-ca authored Jun 18, 2024
2 parents b679b57 + 4ab3376 commit 701fa85
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import javax.management.ListenerNotFoundException;
Expand Down Expand Up @@ -1316,12 +1317,12 @@ public void testThreadMXBeanProxy() {
System.out.println("lockOwnerName ti1: " + ti1.getLockOwnerName() + " ti2: " + ti2.getLockOwnerName());
LockInfo li1 = ti1.getLockInfo();
LockInfo li2 = ti2.getLockInfo();
if (!li2.equals(li1)) {
if (!Objects.equals(li2, li1)) {
System.out.println("lockInfo ti1: " + li1 + " ti2: " + li2);
}
StackTraceElement[] st1 = ti1.getStackTrace();
StackTraceElement[] st2 = ti2.getStackTrace();
if (!st2.equals(st1)) {
if (!Objects.equals(st2, st1)) {
System.out.println("stackTrace length ti1: " + st1.length + " ti2: " + st2.length);
if (st1.length == st2.length) {
for (int i = 0; i < st1.length; i++) {
Expand Down

0 comments on commit 701fa85

Please sign in to comment.