From c2bba72b3133b012642cd312a06555f4e26b369c Mon Sep 17 00:00:00 2001 From: Denis Stepanov Date: Wed, 4 Dec 2024 13:53:18 +0100 Subject: [PATCH] KSP: Use the visitor's context class classloader to get the annotation class --- .../processing/annotation/KotlinAnnotationMetadataBuilder.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/inject-kotlin/src/main/kotlin/io/micronaut/kotlin/processing/annotation/KotlinAnnotationMetadataBuilder.kt b/inject-kotlin/src/main/kotlin/io/micronaut/kotlin/processing/annotation/KotlinAnnotationMetadataBuilder.kt index 6bd7ce1ccf..742fe92c87 100644 --- a/inject-kotlin/src/main/kotlin/io/micronaut/kotlin/processing/annotation/KotlinAnnotationMetadataBuilder.kt +++ b/inject-kotlin/src/main/kotlin/io/micronaut/kotlin/processing/annotation/KotlinAnnotationMetadataBuilder.kt @@ -79,6 +79,7 @@ internal class KotlinAnnotationMetadataBuilder( val annotationMirror = getAnnotationMirror(value.annotationName).orElse(null) if (annotationMirror == null) { return ClassUtils.forName(value.annotationName, null) + .or { ClassUtils.forName(value.annotationName, visitorContext::class.java.classLoader) } .map { it -> it.annotations.any { it.annotationClass.java == Repeatable::class.java } } .orElse(false) }