better assertions

This commit is contained in:
Eugene Zhuravlev
2005-10-27 17:37:00 +04:00
parent 39be229afd
commit 765e2b2b82
3 changed files with 12 additions and 5 deletions
@@ -1478,7 +1478,9 @@ public abstract class DebugProcessImpl implements DebugProcess {
catch (EvaluateException e) {
LOG.error(e);
}
getSuspendManager().popFrame(suspendContext);
finally {
getSuspendManager().popFrame(suspendContext);
}
}
}
@@ -4,7 +4,10 @@ import com.intellij.debugger.engine.events.SuspendContextCommandImpl;
import com.intellij.debugger.jdi.ThreadReferenceProxyImpl;
import com.intellij.openapi.diagnostic.Logger;
import java.util.*;
import java.util.HashSet;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Set;
/*
* Copyright (c) 2000-2004 by JetBrains s.r.o. All Rights Reserved.
@@ -52,10 +55,12 @@ public class SuspendManagerUtil {
Set<SuspendContextImpl> result = new HashSet<SuspendContextImpl>();
for (Iterator<SuspendContextImpl> iterator = suspendManager.getEventContexts().iterator(); iterator.hasNext();) {
SuspendContextImpl suspendContext = iterator.next();
final SuspendContextImpl suspendContext = iterator.next();
if(suspendContext.suspends(thread)) {
ThreadReferenceProxyImpl contextThread = suspendContext.getThread();
LOG.assertTrue(!contextThreads.contains(contextThread));
if (contextThreads.contains(contextThread)) {
LOG.assertTrue(false, suspendContext.toString());
}
contextThreads.add(contextThread);
result.add(suspendContext);
}
@@ -107,7 +107,7 @@ public final class DebuggerContextImpl implements DebuggerContext {
DebuggerCommandImpl currentCommand = getDebugProcess().getManagerThread().getCurrentCommand();
LOG.assertTrue(currentCommand instanceof SuspendContextCommandImpl);
LOG.assertTrue(((SuspendContextCommandImpl)currentCommand).getSuspendContext().getThread() == frameProxy.threadProxy());
LOG.error("Thread : " + frameProxy.threadProxy().name(), e);
LOG.info("Thread : " + frameProxy.threadProxy().name(), e);
objectReference = null;
}
return new EvaluationContextImpl(getSuspendContext(), frameProxy, objectReference);