ENT-1906: Upgrade DJVM to use ASM 6.2.1. (#4000)

This commit is contained in:
Chris Rankin 2018-09-28 11:53:25 +01:00 committed by GitHub
parent 842eac5c43
commit b3b327c135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -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 {

View File

@ -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