FileBasedIndexImpl: a more humble assertion in tests

This commit is contained in:
peter
2015-05-08 10:05:04 +02:00
parent b6cbf386ab
commit ac8cc7607c
@@ -25,10 +25,7 @@ import com.intellij.notification.NotificationDisplayType;
import com.intellij.notification.NotificationGroup;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.actionSystem.ex.ActionUtil;
import com.intellij.openapi.application.ApplicationAdapter;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.application.*;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.impl.EditorHighlighterCache;
@@ -1554,7 +1551,8 @@ public class FileBasedIndexImpl extends FileBasedIndex {
boolean requiresRebuildWasSet = ourRebuildStatus.get(indexId).compareAndSet(OK, REQUIRES_REBUILD);
if (requiresRebuildWasSet) {
String message = "Rebuild requested for index " + indexId;
if (ApplicationManager.getApplication().isUnitTestMode()) {
Application app = ApplicationManager.getApplication();
if (app.isUnitTestMode() && app.isReadAccessAllowed() && !app.isDispatchThread()) {
LOG.error(message, throwable);
} else {
LOG.info(message, throwable);