8215050: [TESTBUG] serviceability/tmtools/jstack/WaitNotifyThreadTest.java fails when run with flag -Xcomp

Identified special case when monitor address is not available in jstack

Reviewed-by: dholmes, hseigel, coleenp
This commit is contained in:
Patricio Chilano Mateo 2018-12-10 13:45:12 -05:00
parent 5a23b59ca0
commit bb6f1e7700

View File

@ -152,7 +152,11 @@ public class WaitNotifyThreadTest {
throw new RuntimeException("Cannot found monitor info associated with " + OBJECT_WAIT + " method");
}
if (mi.getLocks().size() == 1) {
assertMonitorInfo("locked", mi.getLocks().getLast(), monitorAddress, RUN_METHOD);
MonitorInfo monInfo = mi.getLocks().getLast();
if (monitorAddress.equals("no object reference available")) {
monitorAddress = monInfo.getMonitorAddress();
}
assertMonitorInfo("locked", monInfo, monitorAddress, RUN_METHOD);
}
else {
throw new RuntimeException(RUN_METHOD + " method has to contain one lock record but it contains "