diff --git a/core/src/main/kotlin/net/corda/core/serialization/internal/AttachmentsClassLoader.kt b/core/src/main/kotlin/net/corda/core/serialization/internal/AttachmentsClassLoader.kt index e85e5f838f..0e5f1c5053 100644 --- a/core/src/main/kotlin/net/corda/core/serialization/internal/AttachmentsClassLoader.kt +++ b/core/src/main/kotlin/net/corda/core/serialization/internal/AttachmentsClassLoader.kt @@ -19,7 +19,6 @@ import java.io.IOException import java.io.InputStream import java.net.* import java.util.* -import java.util.jar.JarInputStream /** * A custom ClassLoader that knows how to load classes from a set of attachments. The attachments themselves only @@ -318,14 +317,14 @@ object AttachmentsClassLoaderBuilder { isAttachmentTrusted: (Attachment) -> Boolean, parent: ClassLoader = ClassLoader.getSystemClassLoader(), block: (ClassLoader) -> T): T { - val attachmentIds = attachments.map { it.id }.toSet() + val attachmentIds = attachments.map(Attachment::id).toSet() val serializationContext = cache.computeIfAbsent(Key(attachmentIds, params)) { // Create classloader and load serializers, whitelisted classes val transactionClassLoader = AttachmentsClassLoader(attachments, params, txId, isAttachmentTrusted, parent) val serializers = createInstancesOfClassesImplementing(transactionClassLoader, SerializationCustomSerializer::class.java) val whitelistedClasses = ServiceLoader.load(SerializationWhitelist::class.java, transactionClassLoader) - .flatMap { it.whitelist } + .flatMap(SerializationWhitelist::whitelist) .toList() // Create a new serializationContext for the current transaction. In this context we will forbid diff --git a/core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt b/core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt index a7f9e34a31..fcfdf7a240 100644 --- a/core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt +++ b/core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt @@ -151,7 +151,7 @@ private constructor( // Switch thread local deserialization context to using a cached attachments classloader. This classloader enforces various rules // like no-overlap, package namespace ownership and (in future) deterministic Java. return AttachmentsClassLoaderBuilder.withAttachmentsClassloaderContext( - this.attachments + extraAttachments, + attachments + extraAttachments, getParamsWithGoo(), id, isAttachmentTrusted = isAttachmentTrusted) { transactionClassLoader ->