mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-54551 - IAE: ResolveUtil.treeWalkUp
This commit is contained in:
+8
-4
@@ -466,7 +466,9 @@ public class GrCodeReferenceElementImpl extends GrReferenceElementImpl<GrCodeRef
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static GroovyResolveResult[] _resolve(GrCodeReferenceElementImpl ref, PsiManager manager, ReferenceKind kind) {
|
||||
private static GroovyResolveResult[] _resolve(@NotNull GrCodeReferenceElementImpl ref,
|
||||
@NotNull PsiManager manager,
|
||||
@NotNull ReferenceKind kind) {
|
||||
final String refName = ref.getReferenceName();
|
||||
if (refName == null) {
|
||||
return GroovyResolveResult.EMPTY_ARRAY;
|
||||
@@ -515,9 +517,11 @@ public class GrCodeReferenceElementImpl extends GrReferenceElementImpl<GrCodeRef
|
||||
// if ref is an annotation name reference we should not process declarations of annotated elements
|
||||
// because inner annotations are not permitted and it can cause infinite recursion
|
||||
PsiElement placeToStartWalking = isAnnotationRef(ref) ? FileContextUtil.getContextFile(ref) : ref;
|
||||
ResolveUtil.treeWalkUp(placeToStartWalking, processor, false);
|
||||
GroovyResolveResult[] candidates = processor.getCandidates();
|
||||
if (candidates.length > 0) return candidates;
|
||||
if (placeToStartWalking != null) {
|
||||
ResolveUtil.treeWalkUp(placeToStartWalking, processor, false);
|
||||
GroovyResolveResult[] candidates = processor.getCandidates();
|
||||
if (candidates.length > 0) return candidates;
|
||||
}
|
||||
|
||||
if (kind == CLASS_OR_PACKAGE) {
|
||||
PsiPackage pkg = JavaPsiFacade.getInstance(ref.getProject()).findPackage(refName);
|
||||
|
||||
Reference in New Issue
Block a user