From ef45a3d683404038e4271e6eb1a70adf64ef5225 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Tue, 13 Mar 2012 10:11:35 +0100 Subject: [PATCH] typeahead work fix? --- .../openapi/util/TimedOutCallback.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/platform/core-api/src/com/intellij/openapi/util/TimedOutCallback.java b/platform/core-api/src/com/intellij/openapi/util/TimedOutCallback.java index e164879f9a24..ee1bca4a645c 100644 --- a/platform/core-api/src/com/intellij/openapi/util/TimedOutCallback.java +++ b/platform/core-api/src/com/intellij/openapi/util/TimedOutCallback.java @@ -29,6 +29,7 @@ public class TimedOutCallback extends ActionCallback implements Runnable { private Throwable myAllocation; private String myMessage; private SimpleTimerTask myTask; + private boolean myShouldDumpError; public TimedOutCallback(final long timeOut, String message, Throwable allocation, boolean isEdt) { scheduleCheck(timeOut, message, allocation, isEdt); @@ -46,12 +47,11 @@ public class TimedOutCallback extends ActionCallback implements Runnable { myTask = SimpleTimer.getInstance().setUp(new Runnable() { @Override public void run() { - if (System.currentTimeMillis() - current > timeOut) { //double check is necessary :-( - if (isEdt) { - SwingUtilities.invokeLater(TimedOutCallback.this); - } else { - TimedOutCallback.this.run(); - } + myShouldDumpError = System.currentTimeMillis() - current > timeOut; //double check is necessary :-( + if (isEdt) { + SwingUtilities.invokeLater(TimedOutCallback.this); + } else { + TimedOutCallback.this.run(); } } }, timeOut); @@ -61,7 +61,11 @@ public class TimedOutCallback extends ActionCallback implements Runnable { public final void run() { if (!isProcessed()) { setRejected(); - dumpError(); + + if (myShouldDumpError) { + dumpError(); + } + onTimeout(); } }