From e424052272af6fa9f629bba4f16064a875a2e80e Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 25 Jun 2015 13:43:59 +0200 Subject: [PATCH] workaround EA-69947 - IOE: PsiReferenceExpressionImpl.bindToElementViaStaticImport --- .../com/intellij/codeInsight/lookup/VariableLookupItem.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/java-impl/src/com/intellij/codeInsight/lookup/VariableLookupItem.java b/java/java-impl/src/com/intellij/codeInsight/lookup/VariableLookupItem.java index 758121071d45..8eea1dd64231 100644 --- a/java/java-impl/src/com/intellij/codeInsight/lookup/VariableLookupItem.java +++ b/java/java-impl/src/com/intellij/codeInsight/lookup/VariableLookupItem.java @@ -159,6 +159,9 @@ public class VariableLookupItem extends LookupItem implements Typed final PsiReferenceExpression ref = PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), PsiReferenceExpression.class, false); if (ref != null) { + if (ref.isQualified()) { + return; // shouldn't happen, but sometimes we see exceptions because of this + } ref.bindToElementViaStaticImport(((PsiField)variable).getContainingClass()); PostprocessReformattingAspect.getInstance(ref.getProject()).doPostponedFormatting(); }