aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorbennyhuo <bennyhuo@kotliner.cn>2021-10-15 07:49:51 +0800
committerlaszio <ting-yuan@users.noreply.github.com>2021-10-18 23:53:07 -0700
commit9f484e12dafc4080e113f37e57d06935a7b38a6a (patch)
tree344d0fe4223a8b0e5cc0d7d18c7872caa8037b74 /api
parent55239adc23a356032f3b27e9cc481d141997a5a5 (diff)
downloadksp-9f484e12dafc4080e113f37e57d06935a7b38a6a.tar.gz
Fix ClassNotFoundException for initializing annotation arguments in an annotation. The classloader may not be the same with the 'this' class.
Diffstat (limited to 'api')
-rw-r--r--api/src/main/kotlin/com/google/devtools/ksp/utils.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/main/kotlin/com/google/devtools/ksp/utils.kt b/api/src/main/kotlin/com/google/devtools/ksp/utils.kt
index e6fa6693..bb88d16c 100644
--- a/api/src/main/kotlin/com/google/devtools/ksp/utils.kt
+++ b/api/src/main/kotlin/com/google/devtools/ksp/utils.kt
@@ -414,7 +414,7 @@ private fun KSAnnotation.asAnnotation(
annotationInterface: Class<*>,
): Any {
return Proxy.newProxyInstance(
- this.javaClass.classLoader, arrayOf(annotationInterface),
+ annotationInterface.classLoader, arrayOf(annotationInterface),
this.createInvocationHandler(annotationInterface)
) as Proxy
}