diff --git a/src/main/kotlin/net/corda/djvm/serialization/Serialization.kt b/src/main/kotlin/net/corda/djvm/serialization/Serialization.kt index f774fe9bdd..bd15c6da6c 100644 --- a/src/main/kotlin/net/corda/djvm/serialization/Serialization.kt +++ b/src/main/kotlin/net/corda/djvm/serialization/Serialization.kt @@ -75,11 +75,17 @@ inline fun SerializedBytes.deserializeFor(classLoader: Sand } fun ByteSequence.deserializeTo(clazz: Class<*>, classLoader: SandboxClassLoader): Any { - return deserializeTo(clazz, classLoader, SerializationFactory.defaultFactory) + val factory = SerializationFactory.defaultFactory + return deserializeTo(clazz, classLoader, factory, factory.defaultContext) } -fun ByteSequence.deserializeTo(clazz: Class<*>, classLoader: SandboxClassLoader, factory: SerializationFactory): Any { - val obj = factory.deserialize(this, Any::class.java, factory.defaultContext) +fun ByteSequence.deserializeTo( + clazz: Class<*>, + classLoader: SandboxClassLoader, + factory: SerializationFactory, + context: SerializationContext +): Any { + val obj = factory.deserialize(this, Any::class.java, context) return if (clazz.isInstance(obj)) { obj } else {