8280555: serviceability/sa/TestObjectMonitorIterate.java is failing due to ObjectMonitor referencing a null Object
Reviewed-by: sspitsyn, lmesnik
This commit is contained in:
parent
ff34d624ba
commit
0740ac474c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, NTT DATA.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -59,8 +59,12 @@ public class TestObjectMonitorIterate {
|
||||
|
||||
while (itr.hasNext()) {
|
||||
ObjectMonitor mon = (ObjectMonitor)itr.next();
|
||||
Oop oop = heap.newOop(mon.object());
|
||||
System.out.println("Monitor found: " + oop.getKlass().getName().asString());
|
||||
if (mon.object() == null) {
|
||||
System.out.println("Monitor found: object is null");
|
||||
} else {
|
||||
Oop oop = heap.newOop(mon.object());
|
||||
System.out.println("Monitor found: " + oop.getKlass().getName().asString());
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
agent.detach();
|
||||
|
Loading…
x
Reference in New Issue
Block a user