// ensure args are not collected
for (Object arg : myArgs) {
if (arg instanceof ObjectReference) {
- ((ObjectReference)arg).disableCollection();
+ DebuggerUtilsEx.disableCollection((ObjectReference)arg);
}
}
}
// ensure args are not collected
for (Object arg : myArgs) {
if (arg instanceof ObjectReference) {
- ((ObjectReference)arg).enableCollection();
+ DebuggerUtilsEx.enableCollection((ObjectReference)arg);
}
}
}
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
import com.intellij.debugger.engine.events.SuspendContextCommandImpl;
+import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.debugger.jdi.StackFrameProxyImpl;
import com.intellij.debugger.jdi.ThreadReferenceProxyImpl;
import com.intellij.openapi.diagnostic.Logger;
try {
if (!Patches.IBM_JDK_DISABLE_COLLECTION_BUG) {
for (ObjectReference objectReference : myKeptReferences) {
- try {
- objectReference.enableCollection();
- }
- catch (UnsupportedOperationException ignored) {
- // ignore: some J2ME implementations does not provide this operation
- }
+ DebuggerUtilsEx.enableCollection(objectReference);
}
myKeptReferences.clear();
}
if (!Patches.IBM_JDK_DISABLE_COLLECTION_BUG) {
final boolean added = myKeptReferences.add(reference);
if (added) {
- try {
- reference.disableCollection();
- }
- catch (UnsupportedOperationException ignored) {
- // ignore: some J2ME implementations does not provide this operation
- }
+ DebuggerUtilsEx.disableCollection(reference);
}
}
}
}
};
+ public static void disableCollection(ObjectReference reference) {
+ try {
+ reference.disableCollection();
+ }
+ catch (UnsupportedOperationException ignored) {
+ // ignore: some J2ME implementations does not provide this operation
+ }
+ }
+
+ public static void enableCollection(ObjectReference reference) {
+ try {
+ reference.enableCollection();
+ }
+ catch (UnsupportedOperationException ignored) {
+ // ignore: some J2ME implementations does not provide this operation
+ }
+ }
}