From afc89639cfa5417e096627cb4916b0a503000ea3 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Thu, 5 Sep 2019 11:42:47 +0700 Subject: [PATCH] Revert "UAnnotationUtils#getContainingUAnnotationEntry: avoid expensive parent.kind call when not in the annotation" This reverts commit 9b998539: the patch doesn't actually help to avoid analyze call, just defers it to the later phase GitOrigin-RevId: d6fbbc154e279baca46590d65684bf65183a45f8 --- .../src/org/jetbrains/uast/UAnnotationUtils.kt | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/uast/uast-common/src/org/jetbrains/uast/UAnnotationUtils.kt b/uast/uast-common/src/org/jetbrains/uast/UAnnotationUtils.kt index 9ff9d3de6c1a..ad721a1286f3 100644 --- a/uast/uast-common/src/org/jetbrains/uast/UAnnotationUtils.kt +++ b/uast/uast-common/src/org/jetbrains/uast/UAnnotationUtils.kt @@ -96,23 +96,7 @@ fun getContainingUAnnotationEntry(uElement: UElement?): Pair true - is UReferenceExpression -> uElement is UExpression && parent.sourcePsi.toUElementOfType() != null - is UCallExpression -> - if (uElement is UExpression && parent.sourcePsi.toUElementOfType() != null) true - else isAnnotationComponent(parent) - is UPolyadicExpression, is UNamedExpression -> isAnnotationComponent(parent) - else -> false - } - } - - return if (isAnnotationComponent(uElement)) retrievePsiAnnotationEntry(uElement, null) else null + return retrievePsiAnnotationEntry(uElement, null) } fun getContainingAnnotationEntry(uElement: UElement?): Pair? {