EA-51538 - assert: PsiDocumentManagerBase.cancelAndRunWhenAllCommitted

This commit is contained in:
Alexey Kudravtsev
2013-11-13 14:35:00 +04:00
parent 023aed11ac
commit d278cef89a
@@ -243,7 +243,9 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
}
if (myUncommittedDocuments.isEmpty()) {
action.run();
assert actionsWhenAllDocumentsAreCommitted.isEmpty() : actionsWhenAllDocumentsAreCommitted;
if (!hasUncommitedDocuments()) {
assert actionsWhenAllDocumentsAreCommitted.isEmpty() : actionsWhenAllDocumentsAreCommitted;
}
return true;
}
actionsWhenAllDocumentsAreCommitted.put(key, action);
@@ -496,9 +498,14 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen
if (!hasUncommitedDocuments() && !actionsWhenAllDocumentsAreCommitted.isEmpty()) {
List<Object> keys = new ArrayList<Object>(actionsWhenAllDocumentsAreCommitted.keySet());
for (Object key : keys) {
Runnable action = actionsWhenAllDocumentsAreCommitted.remove(key);
myDocumentCommitProcessor.log("Running after commit runnable: ", null, false, key, action);
action.run();
try {
Runnable action = actionsWhenAllDocumentsAreCommitted.remove(key);
myDocumentCommitProcessor.log("Running after commit runnable: ", null, false, key, action);
action.run();
}
catch (Throwable e) {
LOG.error(e);
}
}
}
}