catch INRE (EA-36351)

This commit is contained in:
peter
2012-07-09 15:04:36 +02:00
parent 5c886ca507
commit 567e265d4e
2 changed files with 11 additions and 3 deletions
@@ -38,6 +38,7 @@ import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
@@ -407,6 +408,9 @@ public class FindUsagesManager implements JDOMExternalizable {
try {
searcher.processElementUsages(element, processor, options);
}
catch (IndexNotReadyException e) {
DumbService.getInstance(element.getProject()).showDumbModeNotification("Find usages is not available during indexing");
}
catch (Exception e) {
LOG.error(e);
}
@@ -221,9 +221,13 @@ public class DumbServiceImpl extends DumbService {
@Override
public void showDumbModeNotification(final String message) {
final IdeFrame ideFrame = WindowManager.getInstance().getIdeFrame(myProject);
StatusBarEx statusBar = (StatusBarEx)ideFrame.getStatusBar();
statusBar.notifyProgressByBalloon(MessageType.WARNING, message, null, null);
UIUtil.invokeLaterIfNeeded(new Runnable() {
public void run() {
final IdeFrame ideFrame = WindowManager.getInstance().getIdeFrame(myProject);
StatusBarEx statusBar = (StatusBarEx)ideFrame.getStatusBar();
statusBar.notifyProgressByBalloon(MessageType.WARNING, message, null, null);
}
});
}
private static final Ref<CacheUpdateRunner> NULL_ACTION = new Ref<CacheUpdateRunner>(null);