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