diff --git a/djvm/build.gradle b/djvm/build.gradle index 7120ed8612..db88e8c4c5 100644 --- a/djvm/build.gradle +++ b/djvm/build.gradle @@ -9,7 +9,7 @@ description 'Corda deterministic JVM sandbox' ext { // Shaded version of ASM to avoid conflict with root project. - asm_version = '6.1.1' + asm_version = '6.2.1' } repositories { diff --git a/djvm/src/main/kotlin/net/corda/djvm/rewiring/SandboxClassWriter.kt b/djvm/src/main/kotlin/net/corda/djvm/rewiring/SandboxClassWriter.kt index 9eb74e3aee..e1a051d45c 100644 --- a/djvm/src/main/kotlin/net/corda/djvm/rewiring/SandboxClassWriter.kt +++ b/djvm/src/main/kotlin/net/corda/djvm/rewiring/SandboxClassWriter.kt @@ -22,15 +22,17 @@ import org.objectweb.asm.Type */ open class SandboxClassWriter( classReader: ClassReader, - private val classLoader: ClassLoader, + private val cloader: ClassLoader, flags: Int = COMPUTE_FRAMES or COMPUTE_MAXS ) : ClassWriter(classReader, flags) { + override fun getClassLoader(): ClassLoader = cloader + /** * Get the common super type of [type1] and [type2]. */ override fun getCommonSuperClass(type1: String, type2: String): String { - // Need to override [getCommonSuperClass] to ensure that the correct class loader is used. + // Need to override [getCommonSuperClass] to ensure that we use ClassLoader.loadClass(). when { type1 == OBJECT_NAME -> return type1 type2 == OBJECT_NAME -> return type2