*/
public boolean isCollected() {
// Note that this information should not be cached.
initJdwpRequest();
try {
JdwpReplyPacket replyPacket = requestVM(
JdwpCommandPacket.OR_IS_COLLECTED, this);
switch (replyPacket.errorCode()) {
case JdwpReplyPacket.INVALID_OBJECT:
return true;
case JdwpReplyPacket.NOT_IMPLEMENTED:
// Workaround for problem in J2ME WTK (wireless toolkit)
// @see Bug 12966
try {
referenceType();
} catch (ObjectCollectedException e) {
return true;
}
return false;
default:
defaultReplyErrorHandler(replyPacket.errorCode());
break;
}
DataInputStream replyData = replyPacket.dataInStream();
boolean result = readBoolean("is collected", replyData); //$NON-NLS-1$
return result;
} catch (IOException e) {
defaultIOExceptionHandler(e);
return false;