From fd3f929a11e15e41e21ea1dd6a495bec4e0d0123 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Fri, 19 Sep 2014 15:11:15 +0400 Subject: [PATCH] Guessing class ids for external annotations --- .../resolve/java/structure/impl/JavaAnnotationImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/structure/impl/JavaAnnotationImpl.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/structure/impl/JavaAnnotationImpl.java index 2009d87c8e4..d3b287f8368 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/structure/impl/JavaAnnotationImpl.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/structure/impl/JavaAnnotationImpl.java @@ -52,7 +52,14 @@ public class JavaAnnotationImpl extends JavaElementImpl implement @Nullable public ClassId getClassId() { PsiClass resolved = resolvePsi(); - return resolved == null ? null : computeClassId(resolved); + if (resolved != null) return computeClassId(resolved); + + // External annotations do not have PSI behind them, + // so we can only heuristically reconstruct annotation class ids from qualified names + String qualifiedName = getPsi().getQualifiedName(); + if (qualifiedName != null) return ClassId.topLevel(new FqName(qualifiedName)); + + return null; } @Nullable