if (mainThread.frames().size() != mainThread.frameCount()) {
failure("FAILED: frames size not equal to frameCount");
}
/* Test monitor frame info.
*/ if (vm().canGetMonitorFrameInfo()) {
System.out.println("Get monitors");
monitors = mainThread.ownedMonitorsAndFrames(); if (monitors.size() != expectedCount) {
failure("monitors count is not equal to expected count");
}
MonitorInfo mon = null; for (int j=0; j < monitors.size(); j++) {
mon = (MonitorInfo)monitors.get(j);
System.out.println("Monitor obj " + mon.monitor() + "depth =" +mon.stackDepth()); if (mon.stackDepth() != expectedDepth[j]) {
failure("FAILED: monitor stack depth is not equal to expected depth");
}
}
// The last gotten monInfo is in mon. When we resume the thread, // it should become invalid. We will step out of the top frame // so that the frame depth in this mon object will no longer be correct. // That is why the monInfo's have to become invalid when the thread is // resumed.
stepOut(mainThread); boolean ok = false; try {
System.out.println("*** Saved Monitor obj " + mon.monitor() + "depth =" +mon.stackDepth());
} catch(InvalidStackFrameException ee) { // ok
ok = true;
System.out.println("Got expected InvalidStackFrameException after a resume");
} if (!ok) {
failure("FAILED: MonitorInfo object was not invalidated by a resume");
}
} else {
System.out.println("can not get monitors frame info");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.