tolerate INRE in java element renderers (EA-91963 - INRE: FileBasedIndexImpl.handleDu...
authorpeter <peter@jetbrains.com>
Wed, 16 Nov 2016 17:26:59 +0000 (18:26 +0100)
committerpeter <peter@jetbrains.com>
Wed, 16 Nov 2016 17:41:46 +0000 (18:41 +0100)
java/java-psi-impl/src/com/intellij/psi/presentation/java/JavaPresentationUtil.java

index 9ac376a686c9b5a29a75af96ab0a0d2061c32514..7e2a81b08b921a0ea938082d316a3aed8b4b62c1 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.navigation.ColoredItemPresentation;
 import com.intellij.navigation.ItemPresentation;
 import com.intellij.openapi.editor.colors.CodeInsightColors;
 import com.intellij.openapi.editor.colors.TextAttributesKey;
+import com.intellij.openapi.project.IndexNotReadyException;
 import com.intellij.openapi.util.Iconable;
 import com.intellij.psi.*;
 import com.intellij.psi.util.PsiFormatUtil;
@@ -47,8 +48,12 @@ public class JavaPresentationUtil {
 
       @Override
       public TextAttributesKey getTextAttributesKey() {
-        if (psiMethod.isDeprecated()) {
-          return CodeInsightColors.DEPRECATED_ATTRIBUTES;
+        try {
+          if (psiMethod.isDeprecated()) {
+            return CodeInsightColors.DEPRECATED_ATTRIBUTES;
+          }
+        }
+        catch (IndexNotReadyException ignore) {
         }
         return null;
       }
@@ -75,8 +80,12 @@ public class JavaPresentationUtil {
 
       @Override
       public TextAttributesKey getTextAttributesKey() {
-        if (psiField.isDeprecated()) {
-          return CodeInsightColors.DEPRECATED_ATTRIBUTES;
+        try {
+          if (psiField.isDeprecated()) {
+            return CodeInsightColors.DEPRECATED_ATTRIBUTES;
+          }
+        }
+        catch (IndexNotReadyException ignore) {
         }
         return null;
       }