Skip to content

Commit 1442539

Browse files
Merge pull request #471 from brohacz/classloader_fix
DefaultMethodHandler to use the same class loader as the method`s dec…
2 parents 3b4a2fc + 0bb0a64 commit 1442539

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

buildSrc/src/main/kotlin/ktorm.publish.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ publishing {
151151
name.set("michaelfyc")
152152
email.set("michael.fyc@outlook.com")
153153
}
154+
developer {
155+
id.set("brohacz")
156+
name.set("Michal Brosig")
157+
}
154158
}
155159
}
156160
}

ktorm-core/src/main/kotlin/org/ktorm/entity/DefaultMethodHandler.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ internal class DefaultMethodHandler(
120120
val handle = unreflectSpecial(method)
121121
DefaultMethodHandler(javaDefaultMethodHandle = handle)
122122
} else {
123-
val cls = Class.forName(method.declaringClass.name + "\$DefaultImpls")
123+
val cls = Class.forName(
124+
method.declaringClass.name + "\$DefaultImpls",
125+
true,
126+
method.declaringClass.classLoader
127+
)
124128
val impl = cls.getMethod(method.name, method.declaringClass, *method.parameterTypes)
125129
DefaultMethodHandler(kotlinDefaultImplMethod = impl)
126130
}

0 commit comments

Comments
 (0)