From ce68fe93f6c9e7a6fd5c19226afd0aa833c4fe8e Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Mon, 21 Apr 2014 18:13:51 +0400 Subject: [PATCH] Use stubs to get parent in DiagnosticsWithSuppression --- .../jet/lang/resolve/DiagnosticsWithSuppression.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DiagnosticsWithSuppression.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DiagnosticsWithSuppression.java index 1ea64c07395..71e03d32439 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DiagnosticsWithSuppression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DiagnosticsWithSuppression.java @@ -20,7 +20,6 @@ import com.google.common.collect.ImmutableSet; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.Condition; import com.intellij.psi.PsiElement; -import com.intellij.psi.util.PsiTreeUtil; import com.intellij.util.containers.ConcurrentWeakValueHashMap; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.FilteringIterator; @@ -30,6 +29,7 @@ import org.jetbrains.jet.lang.diagnostics.Diagnostic; import org.jetbrains.jet.lang.diagnostics.Severity; import org.jetbrains.jet.lang.psi.JetAnnotated; import org.jetbrains.jet.lang.psi.JetAnnotationEntry; +import org.jetbrains.jet.lang.psi.JetStubbedPsiUtil; import org.jetbrains.jet.lang.resolve.constants.ArrayValue; import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; import org.jetbrains.jet.lang.resolve.constants.StringValue; @@ -95,7 +95,7 @@ public class DiagnosticsWithSuppression implements Diagnostics { private boolean isSuppressed(@NotNull Diagnostic diagnostic) { PsiElement element = diagnostic.getPsiElement(); - JetAnnotated annotated = PsiTreeUtil.getParentOfType(element, JetAnnotated.class, false); + JetAnnotated annotated = JetStubbedPsiUtil.getPsiOrStubParent(element, JetAnnotated.class, false); if (annotated == null) return false; return isSuppressedByAnnotated(diagnostic, annotated, 0); @@ -140,7 +140,7 @@ public class DiagnosticsWithSuppression implements Diagnostics { Suppressor suppressor = getOrCreateSuppressor(annotated); if (suppressor.isSuppressed(diagnostic)) return true; - JetAnnotated annotatedAbove = PsiTreeUtil.getParentOfType(suppressor.getAnnotatedElement(), JetAnnotated.class, true); + JetAnnotated annotatedAbove = JetStubbedPsiUtil.getPsiOrStubParent(suppressor.getAnnotatedElement(), JetAnnotated.class, true); if (annotatedAbove == null) return false; boolean suppressed = isSuppressedByAnnotated(diagnostic, annotatedAbove, debugDepth + 1);