diff --git a/constants.properties b/constants.properties index d84f3f0622..1019f29656 100644 --- a/constants.properties +++ b/constants.properties @@ -30,7 +30,7 @@ snakeYamlVersion=1.19 caffeineVersion=2.7.0 metricsVersion=4.1.0 metricsNewRelicVersion=1.1.1 -djvmVersion=1.0-RC04 +djvmVersion=1.0-RC05 deterministicRtVersion=1.0-RC02 openSourceBranch=https://github.com/corda/corda/blob/release/os/4.4 openSourceSamplesBranch=https://github.com/corda/samples/blob/release-V4 diff --git a/node/src/main/kotlin/net/corda/node/internal/djvm/AttachmentFactory.kt b/node/src/main/kotlin/net/corda/node/internal/djvm/AttachmentFactory.kt index a16447dced..9a616aa813 100644 --- a/node/src/main/kotlin/net/corda/node/internal/djvm/AttachmentFactory.kt +++ b/node/src/main/kotlin/net/corda/node/internal/djvm/AttachmentFactory.kt @@ -7,8 +7,8 @@ import net.corda.node.djvm.AttachmentBuilder import java.util.function.Function class AttachmentFactory( - private val classLoader: SandboxClassLoader, - private val taskFactory: Function>, + classLoader: SandboxClassLoader, + private val taskFactory: Function>, out Function>, private val sandboxBasicInput: Function, private val serializer: Serializer ) { @@ -17,7 +17,7 @@ class AttachmentFactory( ) fun toSandbox(attachments: List): Any? { - val builder = classLoader.createTaskFor(taskFactory, AttachmentBuilder::class.java) + val builder = taskFactory.apply(AttachmentBuilder::class.java) for (attachment in attachments) { builder.apply(arrayOf( serializer.deserialize(attachment.signerKeys.serialize()), diff --git a/node/src/main/kotlin/net/corda/node/internal/djvm/CommandFactory.kt b/node/src/main/kotlin/net/corda/node/internal/djvm/CommandFactory.kt index ccef9690ac..3727b1b0b6 100644 --- a/node/src/main/kotlin/net/corda/node/internal/djvm/CommandFactory.kt +++ b/node/src/main/kotlin/net/corda/node/internal/djvm/CommandFactory.kt @@ -1,15 +1,13 @@ package net.corda.node.internal.djvm -import net.corda.djvm.rewiring.SandboxClassLoader import net.corda.node.djvm.CommandBuilder import java.util.function.Function class CommandFactory( - private val classLoader: SandboxClassLoader, - private val taskFactory: Function> + private val taskFactory: Function>, out Function> ) { fun toSandbox(signers: Any?, commands: Any?, partialMerkleLeafIndices: IntArray?): Any? { - val builder = classLoader.createTaskFor(taskFactory, CommandBuilder::class.java) + val builder = taskFactory.apply(CommandBuilder::class.java) return builder.apply(arrayOf( signers, commands, diff --git a/node/src/main/kotlin/net/corda/node/internal/djvm/ComponentFactory.kt b/node/src/main/kotlin/net/corda/node/internal/djvm/ComponentFactory.kt index 9645522baf..e75da8eb70 100644 --- a/node/src/main/kotlin/net/corda/node/internal/djvm/ComponentFactory.kt +++ b/node/src/main/kotlin/net/corda/node/internal/djvm/ComponentFactory.kt @@ -11,7 +11,7 @@ import java.util.function.Function class ComponentFactory( private val classLoader: SandboxClassLoader, - private val taskFactory: Function>, + private val taskFactory: Function>, out Function>, private val sandboxBasicInput: Function, private val serializer: Serializer, private val componentGroups: List @@ -22,7 +22,7 @@ class ComponentFactory( ): Any? { val components = (componentGroups.firstOrNull(groupType::isSameType) ?: return null).components val componentBytes = Array(components.size) { idx -> components[idx].bytes } - return classLoader.createTaskFor(taskFactory, ComponentBuilder::class.java).apply(arrayOf( + return taskFactory.apply(ComponentBuilder::class.java).apply(arrayOf( classLoader.createForImport(serializer.deserializerFor(clazz)), sandboxBasicInput.apply(groupType), componentBytes diff --git a/node/src/main/kotlin/net/corda/node/internal/djvm/DeterministicVerifier.kt b/node/src/main/kotlin/net/corda/node/internal/djvm/DeterministicVerifier.kt index fb1e038365..bbca77ce47 100644 --- a/node/src/main/kotlin/net/corda/node/internal/djvm/DeterministicVerifier.kt +++ b/node/src/main/kotlin/net/corda/node/internal/djvm/DeterministicVerifier.kt @@ -63,7 +63,7 @@ class DeterministicVerifier( externalCaching = false } - val taskFactory = classLoader.createRawTaskFactory() + val taskFactory = classLoader.createRawTaskFactory().compose(classLoader.createSandboxFunction()) val sandboxBasicInput = classLoader.createBasicInput() /** @@ -92,11 +92,11 @@ class DeterministicVerifier( val privacySaltData = ltx.privacySalt.serialize() val networkingParametersData = ltx.networkParameters?.serialize() - val createSandboxTx = classLoader.createTaskFor(taskFactory, LtxFactory::class.java) + val createSandboxTx = taskFactory.apply(LtxFactory::class.java) createSandboxTx.apply(arrayOf( serializer.deserialize(serializedInputs), componentFactory.toSandbox(OUTPUTS_GROUP, TransactionState::class.java), - CommandFactory(classLoader, taskFactory).toSandbox( + CommandFactory(taskFactory).toSandbox( componentFactory.toSandbox(SIGNERS_GROUP, List::class.java), componentFactory.toSandbox(COMMANDS_GROUP, CommandData::class.java), componentFactory.calculateLeafIndicesFor(COMMANDS_GROUP) @@ -111,7 +111,7 @@ class DeterministicVerifier( )) } - val verifier = classLoader.createTaskFor(taskFactory, ContractVerifier::class.java) + val verifier = taskFactory.apply(ContractVerifier::class.java) // Now execute the contract verifier task within the sandbox... verifier.apply(sandboxTx) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/AMQPSerializationScheme.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/AMQPSerializationScheme.kt index 5954b92a67..948be91685 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/AMQPSerializationScheme.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/AMQPSerializationScheme.kt @@ -63,13 +63,14 @@ import java.util.function.Function class AMQPSerializationScheme( private val classLoader: SandboxClassLoader, private val sandboxBasicInput: Function, - private val taskFactory: Function>, + private val rawTaskFactory: Function>, private val customSerializerClassNames: Set, private val serializationWhitelistNames: Set, private val serializerFactoryFactory: SerializerFactoryFactory ) : SerializationScheme { private fun getSerializerFactory(context: SerializationContext): SerializerFactory { + val taskFactory = rawTaskFactory.compose(classLoader.createSandboxFunction()) return serializerFactoryFactory.make(context).apply { register(SandboxBitSetSerializer(classLoader, taskFactory, this)) register(SandboxCertPathSerializer(classLoader, taskFactory, this)) @@ -105,9 +106,9 @@ class AMQPSerializationScheme( register(SandboxMapSerializer(classLoader, taskFactory, this)) register(SandboxEnumSerializer(classLoader, taskFactory, this)) register(SandboxPublicKeySerializer(classLoader, taskFactory)) - register(SandboxToStringSerializer(BigDecimal::class.java, classLoader, taskFactory, sandboxBasicInput)) - register(SandboxToStringSerializer(BigInteger::class.java, classLoader, taskFactory, sandboxBasicInput)) - register(SandboxToStringSerializer(StringBuffer::class.java, classLoader, taskFactory, sandboxBasicInput)) + register(SandboxToStringSerializer(BigDecimal::class.java, classLoader, rawTaskFactory, sandboxBasicInput)) + register(SandboxToStringSerializer(BigInteger::class.java, classLoader, rawTaskFactory, sandboxBasicInput)) + register(SandboxToStringSerializer(StringBuffer::class.java, classLoader, rawTaskFactory, sandboxBasicInput)) register(SandboxCurrencySerializer(classLoader, taskFactory, sandboxBasicInput)) register(SandboxX509CertificateSerializer(classLoader, taskFactory)) register(SandboxX509CRLSerializer(classLoader, taskFactory)) @@ -121,13 +122,16 @@ class AMQPSerializationScheme( register(SandboxSymbolSerializer(classLoader, taskFactory, sandboxBasicInput)) for (customSerializerName in customSerializerClassNames) { - register(SandboxCorDappCustomSerializer(customSerializerName, classLoader, taskFactory, this)) + register(SandboxCorDappCustomSerializer(customSerializerName, classLoader, rawTaskFactory, this)) } - registerWhitelists(this) + registerWhitelists(taskFactory, this) } } - private fun registerWhitelists(factory: SerializerFactory) { + private fun registerWhitelists( + taskFactory: Function>, out Function>, + factory: SerializerFactory + ) { if (serializationWhitelistNames.isEmpty()) { return } @@ -136,7 +140,7 @@ class AMQPSerializationScheme( classLoader.toSandboxClass(whitelistClass).kotlin.objectOrNewInstance() }.toArrayOf(classLoader.toSandboxClass(SerializationWhitelist::class.java)) @Suppress("unchecked_cast") - val mergeTask = classLoader.createTaskFor(taskFactory, MergeWhitelists::class.java) as Function, out Array>> + val mergeTask = taskFactory.apply(MergeWhitelists::class.java) as Function, out Array>> factory.addToWhitelist(mergeTask.apply(serializationWhitelists).toSet()) } diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/Serialization.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/Serialization.kt index a56ec8652a..2f89fb1317 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/Serialization.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/Serialization.kt @@ -42,7 +42,7 @@ fun createSandboxSerializationEnv( encoding = null ) - val taskFactory = classLoader.createRawTaskFactory() + val rawTaskFactory = classLoader.createRawTaskFactory() val sandboxBasicInput = classLoader.createBasicInput() val primitiveSerializerFactory: Function, AMQPSerializer> = Function { clazz -> @@ -53,7 +53,7 @@ fun createSandboxSerializationEnv( registerScheme(AMQPSerializationScheme( classLoader = classLoader, sandboxBasicInput = sandboxBasicInput, - taskFactory = taskFactory, + rawTaskFactory = rawTaskFactory, customSerializerClassNames = customSerializerClassNames, serializationWhitelistNames = serializationWhitelistNames, serializerFactoryFactory = SandboxSerializerFactoryFactory(primitiveSerializerFactory) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxBitSetSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxBitSetSerializer.kt index 778bba4d8d..af11ec7887 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxBitSetSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxBitSetSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxBitSetSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(BitSet::class.java), proxyClass = classLoader.toSandboxAnyClass(BitSetProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, BitSetDeserializer::class.java) + private val task = taskFactory.apply(BitSetDeserializer::class.java) override val deserializationAliases = aliasFor(BitSet::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCertPathSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCertPathSerializer.kt index f08bc90f95..0d6cd7aff5 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCertPathSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCertPathSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxCertPathSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(CertPath::class.java), proxyClass = classLoader.toSandboxAnyClass(CertPathProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, CertPathDeserializer::class.java) + private val task = taskFactory.apply(CertPathDeserializer::class.java) override val deserializationAliases = aliasFor(CertPath::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxClassSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxClassSerializer.kt index 7f2d0abf02..46d3be88b3 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxClassSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxClassSerializer.kt @@ -12,14 +12,14 @@ import java.util.function.Function @Suppress("unchecked_cast") class SandboxClassSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = Class::class.java as Class, proxyClass = classLoader.toSandboxAnyClass(ClassProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, ClassDeserializer::class.java) + private val task = taskFactory.apply(ClassDeserializer::class.java) private val nameOf: Function init { diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCollectionSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCollectionSerializer.kt index 0f2f53c6f2..d64413a023 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCollectionSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCollectionSerializer.kt @@ -26,12 +26,12 @@ import java.util.function.Function class SandboxCollectionSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, private val localFactory: LocalSerializerFactory ) : CustomSerializer.Implements(clazz = classLoader.toSandboxAnyClass(Collection::class.java)) { @Suppress("unchecked_cast") private val creator: Function, out Any?> - = classLoader.createTaskFor(taskFactory, CreateCollection::class.java) as Function, out Any?> + = taskFactory.apply(CreateCollection::class.java) as Function, out Any?> private val unsupportedTypes: Set> = listOf( EnumSet::class.java diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCorDappCustomSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCorDappCustomSerializer.kt index 5e3f30384c..9420dddf9b 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCorDappCustomSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCorDappCustomSerializer.kt @@ -30,7 +30,7 @@ import java.util.function.Function class SandboxCorDappCustomSerializer( private val serializerName: String, classLoader: SandboxClassLoader, - taskFactory: Function>, + rawTaskFactory: Function>, factory: SerializerFactory ) : CustomSerializer() { private val unproxy: Function @@ -53,7 +53,7 @@ class SandboxCorDappCustomSerializer( val unproxyTask = classLoader.toSandboxClass(CorDappCustomDeserializer::class.java) .getConstructor(serializationCustomSerializer) .newInstance(customSerializerClass.kotlin.objectOrNewInstance()) - unproxy = taskFactory.apply(unproxyTask) + unproxy = rawTaskFactory.apply(unproxyTask) } override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCurrencySerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCurrencySerializer.kt index 053386b0f7..758943ee96 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCurrencySerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxCurrencySerializer.kt @@ -16,13 +16,13 @@ import java.util.function.Function class SandboxCurrencySerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, basicInput: Function ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(Currency::class.java)) { private val creator: Function init { - val createTask = classLoader.createTaskFor(taskFactory, CreateCurrency::class.java) + val createTask = taskFactory.apply(CreateCurrency::class.java) creator = basicInput.andThen(createTask) } diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal128Serializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal128Serializer.kt index d7e2e0d248..234a966988 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal128Serializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal128Serializer.kt @@ -16,11 +16,11 @@ import java.util.function.Function class SandboxDecimal128Serializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(Decimal128::class.java)) { @Suppress("unchecked_cast") private val transformer: Function - = classLoader.createTaskFor(taskFactory, Decimal128Deserializer::class.java) as Function + = taskFactory.apply(Decimal128Deserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal32Serializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal32Serializer.kt index 4b83c30a9a..9375431625 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal32Serializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal32Serializer.kt @@ -16,11 +16,11 @@ import java.util.function.Function class SandboxDecimal32Serializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(Decimal32::class.java)) { @Suppress("unchecked_cast") private val transformer: Function - = classLoader.createTaskFor(taskFactory, Decimal32Deserializer::class.java) as Function + = taskFactory.apply(Decimal32Deserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal64Serializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal64Serializer.kt index 6103d8431b..3461cf7d60 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal64Serializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDecimal64Serializer.kt @@ -16,11 +16,11 @@ import java.util.function.Function class SandboxDecimal64Serializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(Decimal64::class.java)) { @Suppress("unchecked_cast") private val transformer: Function - = classLoader.createTaskFor(taskFactory, Decimal64Deserializer::class.java) as Function + = taskFactory.apply(Decimal64Deserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDurationSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDurationSerializer.kt index 0317f6aa9b..8b2f8613e2 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDurationSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxDurationSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxDurationSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(Duration::class.java), proxyClass = classLoader.toSandboxAnyClass(DurationProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, DurationDeserializer::class.java) + private val task = taskFactory.apply(DurationDeserializer::class.java) override val deserializationAliases = aliasFor(Duration::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxEnumSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxEnumSerializer.kt index 859e3e011c..3bd64ce39b 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxEnumSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxEnumSerializer.kt @@ -22,12 +22,12 @@ import java.util.function.Function class SandboxEnumSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, private val localFactory: LocalSerializerFactory ) : CustomSerializer.Implements(clazz = classLoader.toSandboxAnyClass(Enum::class.java)) { @Suppress("unchecked_cast") private val describer: Function, Array> - = classLoader.createTaskFor(taskFactory, DescribeEnum::class.java) as Function, Array> + = taskFactory.apply(DescribeEnum::class.java) as Function, Array> override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxEnumSetSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxEnumSetSerializer.kt index 058a4c44da..4339d472f7 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxEnumSetSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxEnumSetSerializer.kt @@ -12,14 +12,14 @@ import java.util.function.Function class SandboxEnumSetSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(EnumSet::class.java), proxyClass = classLoader.toSandboxAnyClass(EnumSetProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, EnumSetDeserializer::class.java) + private val task = taskFactory.apply(EnumSetDeserializer::class.java) override val additionalSerializers: Set> = singleton( SandboxClassSerializer(classLoader, taskFactory, factory) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxInputStreamSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxInputStreamSerializer.kt index b7098abb29..03c30cd789 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxInputStreamSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxInputStreamSerializer.kt @@ -16,11 +16,11 @@ import java.util.function.Function class SandboxInputStreamSerializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Implements(classLoader.toSandboxAnyClass(InputStream::class.java)) { @Suppress("unchecked_cast") private val decoder: Function - = classLoader.createTaskFor(taskFactory, InputStreamDeserializer::class.java) as Function + = taskFactory.apply(InputStreamDeserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxInstantSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxInstantSerializer.kt index 1d5018f4e4..ae6ed2c48f 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxInstantSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxInstantSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxInstantSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(Instant::class.java), proxyClass = classLoader.toSandboxAnyClass(InstantProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, InstantDeserializer::class.java) + private val task = taskFactory.apply(InstantDeserializer::class.java) override val deserializationAliases = aliasFor(Instant::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalDateSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalDateSerializer.kt index 154bacc4d5..9d09131390 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalDateSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalDateSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxLocalDateSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(LocalDate::class.java), proxyClass = classLoader.toSandboxAnyClass(LocalDateProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, LocalDateDeserializer::class.java) + private val task = taskFactory.apply(LocalDateDeserializer::class.java) override val deserializationAliases = aliasFor(LocalDate::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalDateTimeSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalDateTimeSerializer.kt index 6c68c650f8..8dca5f0617 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalDateTimeSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalDateTimeSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxLocalDateTimeSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(LocalDateTime::class.java), proxyClass = classLoader.toSandboxAnyClass(LocalDateTimeProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, LocalDateTimeDeserializer::class.java) + private val task = taskFactory.apply(LocalDateTimeDeserializer::class.java) override val deserializationAliases = aliasFor(LocalDateTime::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalTimeSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalTimeSerializer.kt index 9ee45968dc..1b545397fa 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalTimeSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxLocalTimeSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxLocalTimeSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(LocalTime::class.java), proxyClass = classLoader.toSandboxAnyClass(LocalTimeProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, LocalTimeDeserializer::class.java) + private val task = taskFactory.apply(LocalTimeDeserializer::class.java) override val deserializationAliases = aliasFor(LocalTime::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxMapSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxMapSerializer.kt index 596118a24b..6e85ea50c0 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxMapSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxMapSerializer.kt @@ -26,12 +26,12 @@ import java.util.function.Function class SandboxMapSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, private val localFactory: LocalSerializerFactory ) : CustomSerializer.Implements(clazz = classLoader.toSandboxAnyClass(Map::class.java)) { @Suppress("unchecked_cast") private val creator: Function, out Any?> - = classLoader.createTaskFor(taskFactory, CreateMap::class.java) as Function, out Any?> + = taskFactory.apply(CreateMap::class.java) as Function, out Any?> // The order matters here - the first match should be the most specific one. // Kotlin preserves the ordering for us by associating into a LinkedHashMap. diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxMonthDaySerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxMonthDaySerializer.kt index 0bd63058df..899dc20a7d 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxMonthDaySerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxMonthDaySerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxMonthDaySerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(MonthDay::class.java), proxyClass = classLoader.toSandboxAnyClass(MonthDayProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, MonthDayDeserializer::class.java) + private val task = taskFactory.apply(MonthDayDeserializer::class.java) override val deserializationAliases = aliasFor(MonthDay::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOffsetDateTimeSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOffsetDateTimeSerializer.kt index 2db488da00..ebff5cdcd3 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOffsetDateTimeSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOffsetDateTimeSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxOffsetDateTimeSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(OffsetDateTime::class.java), proxyClass = classLoader.toSandboxAnyClass(OffsetDateTimeProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, OffsetDateTimeDeserializer::class.java) + private val task = taskFactory.apply(OffsetDateTimeDeserializer::class.java) override val deserializationAliases = aliasFor(OffsetDateTime::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOffsetTimeSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOffsetTimeSerializer.kt index 520dc3ed43..52f5721d13 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOffsetTimeSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOffsetTimeSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxOffsetTimeSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(OffsetTime::class.java), proxyClass = classLoader.toSandboxAnyClass(OffsetTimeProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, OffsetTimeDeserializer::class.java) + private val task = taskFactory.apply(OffsetTimeDeserializer::class.java) override val deserializationAliases = aliasFor(OffsetTime::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOpaqueBytesSubSequenceSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOpaqueBytesSubSequenceSerializer.kt index abeafe2a14..35ac384f5e 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOpaqueBytesSubSequenceSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOpaqueBytesSubSequenceSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxOpaqueBytesSubSequenceSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(OpaqueBytesSubSequence::class.java), proxyClass = classLoader.toSandboxAnyClass(OpaqueBytes::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, OpaqueBytesSubSequenceDeserializer::class.java) + private val task = taskFactory.apply(OpaqueBytesSubSequenceDeserializer::class.java) override val deserializationAliases = aliasFor(OpaqueBytesSubSequence::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOptionalSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOptionalSerializer.kt index b582864dab..82a633d603 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOptionalSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxOptionalSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxOptionalSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(Optional::class.java), proxyClass = classLoader.toSandboxAnyClass(OptionalProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, OptionalDeserializer::class.java) + private val task = taskFactory.apply(OptionalDeserializer::class.java) override val deserializationAliases = aliasFor(Optional::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxPeriodSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxPeriodSerializer.kt index 454dc658a7..2f82e02e80 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxPeriodSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxPeriodSerializer.kt @@ -11,14 +11,14 @@ import java.util.function.Function class SandboxPeriodSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(Period::class.java), proxyClass = classLoader.toSandboxAnyClass(PeriodProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, PeriodDeserializer::class.java) + private val task = taskFactory.apply(PeriodDeserializer::class.java) override val deserializationAliases = aliasFor(Period::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxPublicKeySerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxPublicKeySerializer.kt index e1875c142a..ec528667ee 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxPublicKeySerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxPublicKeySerializer.kt @@ -16,11 +16,11 @@ import java.util.function.Function class SandboxPublicKeySerializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Implements(classLoader.toSandboxAnyClass(PublicKey::class.java)) { @Suppress("unchecked_cast") private val decoder: Function - = classLoader.createTaskFor(taskFactory, PublicKeyDecoder::class.java) as Function + = taskFactory.apply(PublicKeyDecoder::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxSymbolSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxSymbolSerializer.kt index 5ed9719337..bac43a452f 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxSymbolSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxSymbolSerializer.kt @@ -16,13 +16,13 @@ import java.util.function.Function class SandboxSymbolSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, basicInput: Function ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(Symbol::class.java)) { private val transformer: Function init { - val transformTask = classLoader.createTaskFor(taskFactory, SymbolDeserializer::class.java) + val transformTask = taskFactory.apply(SymbolDeserializer::class.java) @Suppress("unchecked_cast") transformer = basicInput.andThen(transformTask) as Function } diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxToStringSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxToStringSerializer.kt index 70680d384a..ba5e7e3830 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxToStringSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxToStringSerializer.kt @@ -17,7 +17,7 @@ import java.util.function.Function class SandboxToStringSerializer( unsafeClass: Class<*>, classLoader: SandboxClassLoader, - taskFactory: Function>, + rawTaskFactory: Function>, basicInput: Function ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(unsafeClass)) { private val creator: Function @@ -27,7 +27,7 @@ class SandboxToStringSerializer( val createTask = classLoader.toSandboxClass(CreateFromString::class.java) .getConstructor(Constructor::class.java) .newInstance(clazz.getConstructor(stringClass)) - creator = basicInput.andThen(taskFactory.apply(createTask)) + creator = basicInput.andThen(rawTaskFactory.apply(createTask)) } override val deserializationAliases = aliasFor(unsafeClass) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedByteSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedByteSerializer.kt index 1eb3f67409..f871186997 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedByteSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedByteSerializer.kt @@ -16,11 +16,11 @@ import java.util.function.Function class SandboxUnsignedByteSerializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(UnsignedByte::class.java)) { @Suppress("unchecked_cast") private val transformer: Function - = classLoader.createTaskFor(taskFactory, UnsignedByteDeserializer::class.java) as Function + = taskFactory.apply(UnsignedByteDeserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedIntegerSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedIntegerSerializer.kt index 38ee46b9b8..7e612d7a10 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedIntegerSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedIntegerSerializer.kt @@ -16,11 +16,11 @@ import java.util.function.Function class SandboxUnsignedIntegerSerializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(UnsignedInteger::class.java)) { @Suppress("unchecked_cast") private val transformer: Function - = classLoader.createTaskFor(taskFactory, UnsignedIntegerDeserializer::class.java) as Function + = taskFactory.apply(UnsignedIntegerDeserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedLongSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedLongSerializer.kt index 9e06c59ca8..b25404377f 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedLongSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedLongSerializer.kt @@ -16,11 +16,11 @@ import java.util.function.Function class SandboxUnsignedLongSerializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(UnsignedLong::class.java)) { @Suppress("unchecked_cast") private val transformer: Function - = classLoader.createTaskFor(taskFactory, UnsignedLongDeserializer::class.java) as Function + = taskFactory.apply(UnsignedLongDeserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedShortSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedShortSerializer.kt index b22ff1cb8c..a999825eb7 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedShortSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxUnsignedShortSerializer.kt @@ -16,11 +16,11 @@ import java.util.function.Function class SandboxUnsignedShortSerializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Is(classLoader.toSandboxAnyClass(UnsignedShort::class.java)) { @Suppress("unchecked_cast") private val transformer: Function - = classLoader.createTaskFor(taskFactory, UnsignedShortDeserializer::class.java) as Function + = taskFactory.apply(UnsignedShortDeserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxX509CRLSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxX509CRLSerializer.kt index c4826374a1..aa52234a97 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxX509CRLSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxX509CRLSerializer.kt @@ -12,16 +12,15 @@ import net.corda.serialization.internal.amqp.SerializationSchemas import org.apache.qpid.proton.codec.Data import java.lang.reflect.Type import java.security.cert.X509CRL -import java.util.Collections.singleton import java.util.function.Function class SandboxX509CRLSerializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Implements(classLoader.toSandboxAnyClass(X509CRL::class.java)) { @Suppress("unchecked_cast") private val generator: Function - = classLoader.createTaskFor(taskFactory, X509CRLDeserializer::class.java) as Function + = taskFactory.apply(X509CRLDeserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxX509CertificateSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxX509CertificateSerializer.kt index d259ef02c7..cab56d34c6 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxX509CertificateSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxX509CertificateSerializer.kt @@ -12,16 +12,15 @@ import net.corda.serialization.internal.amqp.SerializationSchemas import org.apache.qpid.proton.codec.Data import java.lang.reflect.Type import java.security.cert.X509Certificate -import java.util.Collections.singleton import java.util.function.Function class SandboxX509CertificateSerializer( classLoader: SandboxClassLoader, - taskFactory: Function> + taskFactory: Function>, out Function> ) : CustomSerializer.Implements(classLoader.toSandboxAnyClass(X509Certificate::class.java)) { @Suppress("unchecked_cast") private val generator: Function - = classLoader.createTaskFor(taskFactory, X509CertificateDeserializer::class.java) as Function + = taskFactory.apply(X509CertificateDeserializer::class.java) as Function override val schemaForDocumentation: Schema = Schema(emptyList()) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxYearMonthSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxYearMonthSerializer.kt index 525a437e17..051b812368 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxYearMonthSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxYearMonthSerializer.kt @@ -7,19 +7,18 @@ import net.corda.serialization.internal.amqp.CustomSerializer import net.corda.serialization.internal.amqp.SerializerFactory import net.corda.serialization.internal.amqp.custom.YearMonthSerializer.YearMonthProxy import java.time.YearMonth -import java.util.Collections.singleton import java.util.function.Function class SandboxYearMonthSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(YearMonth::class.java), proxyClass = classLoader.toSandboxAnyClass(YearMonthProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, YearMonthDeserializer::class.java) + private val task = taskFactory.apply(YearMonthDeserializer::class.java) override val deserializationAliases = aliasFor(YearMonth::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxYearSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxYearSerializer.kt index e080d7d7bc..776a1ada15 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxYearSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxYearSerializer.kt @@ -7,19 +7,18 @@ import net.corda.serialization.internal.amqp.CustomSerializer import net.corda.serialization.internal.amqp.SerializerFactory import net.corda.serialization.internal.amqp.custom.YearSerializer.YearProxy import java.time.Year -import java.util.Collections.singleton import java.util.function.Function class SandboxYearSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(Year::class.java), proxyClass = classLoader.toSandboxAnyClass(YearProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, YearDeserializer::class.java) + private val task = taskFactory.apply(YearDeserializer::class.java) override val deserializationAliases = aliasFor(Year::class.java) diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxZoneIdSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxZoneIdSerializer.kt index 39f6a87131..722c0ad255 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxZoneIdSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxZoneIdSerializer.kt @@ -7,19 +7,18 @@ import net.corda.serialization.internal.amqp.CustomSerializer import net.corda.serialization.internal.amqp.SerializerFactory import net.corda.serialization.internal.amqp.custom.ZoneIdSerializer.ZoneIdProxy import java.time.ZoneId -import java.util.Collections.singleton import java.util.function.Function class SandboxZoneIdSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(ZoneId::class.java), proxyClass = classLoader.toSandboxAnyClass(ZoneIdProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, ZoneIdDeserializer::class.java) + private val task = taskFactory.apply(ZoneIdDeserializer::class.java) override val revealSubclassesInSchema: Boolean = true diff --git a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxZonedDateTimeSerializer.kt b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxZonedDateTimeSerializer.kt index 07897c6e2d..46bb414f4f 100644 --- a/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxZonedDateTimeSerializer.kt +++ b/serialization-djvm/src/main/kotlin/net/corda/serialization/djvm/serializers/SandboxZonedDateTimeSerializer.kt @@ -10,19 +10,18 @@ import java.time.LocalDateTime import java.time.ZoneId import java.time.ZoneOffset import java.time.ZonedDateTime -import java.util.Collections.singleton import java.util.function.Function class SandboxZonedDateTimeSerializer( classLoader: SandboxClassLoader, - taskFactory: Function>, + taskFactory: Function>, out Function>, factory: SerializerFactory ) : CustomSerializer.Proxy( clazz = classLoader.toSandboxAnyClass(ZonedDateTime::class.java), proxyClass = classLoader.toSandboxAnyClass(ZonedDateTimeProxy::class.java), factory = factory ) { - private val task = classLoader.createTaskFor(taskFactory, ZonedDateTimeDeserializer::class.java) + private val task = taskFactory.apply(ZonedDateTimeDeserializer::class.java) private val creator: Function init { diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigDecimalTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigDecimalTest.kt index cc71c03fd7..592f6bbd59 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigDecimalTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigDecimalTest.kt @@ -28,7 +28,7 @@ class DeserializeBigDecimalTest : TestBase(KOTLIN) { val sandboxBigInteger = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showBigDecimal = classLoader.createTaskFor(taskFactory, ShowBigDecimal::class.java) + val showBigDecimal = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowBigDecimal::class.java) val result = showBigDecimal.apply(sandboxBigInteger) ?: fail("Result cannot be null") assertEquals(ShowBigDecimal().apply(bigDecimal), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigIntegerTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigIntegerTest.kt index 50b7bd3691..10269358aa 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigIntegerTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBigIntegerTest.kt @@ -28,7 +28,7 @@ class DeserializeBigIntegerTest : TestBase(KOTLIN) { val sandboxBigInteger = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showBigInteger = classLoader.createTaskFor(taskFactory, ShowBigInteger::class.java) + val showBigInteger = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowBigInteger::class.java) val result = showBigInteger.apply(sandboxBigInteger) ?: fail("Result cannot be null") assertEquals(ShowBigInteger().apply(bigInteger), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBitSetTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBitSetTest.kt index 9c09ce2847..5bcc0432e2 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBitSetTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeBitSetTest.kt @@ -23,7 +23,7 @@ class DeserializeBitSetTest : TestBase(KOTLIN) { val sandboxBitSet = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showBitSet = classLoader.createTaskFor(taskFactory, ShowBitSet::class.java) + val showBitSet = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowBitSet::class.java) val result = showBitSet.apply(sandboxBitSet) ?: fail("Result cannot be null") assertEquals(bitSet.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCertificatesTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCertificatesTest.kt index 05ef5cd4da..d3724b3318 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCertificatesTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCertificatesTest.kt @@ -60,7 +60,7 @@ class DeserializeCertificatesTest : TestBase(KOTLIN) { val sandboxCertPath = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showCertPath = classLoader.createTaskFor(taskFactory, ShowCertPath::class.java) + val showCertPath = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowCertPath::class.java) val result = showCertPath.apply(sandboxCertPath) ?: fail("Result cannot be null") assertEquals(ShowCertPath().apply(certPath).toUNIX().toJava8Format(), result.toString()) @@ -84,7 +84,7 @@ class DeserializeCertificatesTest : TestBase(KOTLIN) { val sandboxCertificate = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showCertificate = classLoader.createTaskFor(taskFactory, ShowCertificate::class.java) + val showCertificate = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowCertificate::class.java) val result = showCertificate.apply(sandboxCertificate) ?: fail("Result cannot be null") assertEquals(ShowCertificate().apply(certificate).toUNIX().toJava8Format(), result.toString()) @@ -118,7 +118,7 @@ class DeserializeCertificatesTest : TestBase(KOTLIN) { val sandboxCRL = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showCRL = classLoader.createTaskFor(taskFactory, ShowCRL::class.java) + val showCRL = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowCRL::class.java) val result = showCRL.apply(sandboxCRL) ?: fail("Result cannot be null") assertEquals(ShowCRL().apply(crl).toUNIX(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeClassTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeClassTest.kt index 080360a850..d2919f8066 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeClassTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeClassTest.kt @@ -27,7 +27,7 @@ class DeserializeClassTest : TestBase(KOTLIN) { val sandboxInstant = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showClass = classLoader.createTaskFor(taskFactory, ShowClass::class.java) + val showClass = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowClass::class.java) val result = showClass.apply(sandboxInstant) ?: fail("Result cannot be null") assertEquals("sandbox.${myClass.name}", result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCollectionsTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCollectionsTest.kt index 7b328c1d8c..3022db0336 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCollectionsTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCollectionsTest.kt @@ -28,7 +28,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { val sandboxList = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringList = classLoader.createTaskFor(taskFactory, ShowStringList::class.java) + val showStringList = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowStringList::class.java) val result = showStringList.apply(sandboxList) ?: fail("Result cannot be null") assertEquals(stringList.lines.joinToString(), result.toString()) @@ -53,7 +53,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { val sandboxSet = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showIntegerSet = classLoader.createTaskFor(taskFactory, ShowIntegerSet::class.java) + val showIntegerSet = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowIntegerSet::class.java) val result = showIntegerSet.apply(sandboxSet) ?: fail("Result cannot be null") assertEquals(integerSet.numbers.joinToString(), result.toString()) @@ -78,7 +78,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { val sandboxSet = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showIntegerSortedSet = classLoader.createTaskFor(taskFactory, ShowIntegerSortedSet::class.java) + val showIntegerSortedSet = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowIntegerSortedSet::class.java) val result = showIntegerSortedSet.apply(sandboxSet) ?: fail("Result cannot be null") assertEquals(integerSortedSet.numbers.joinToString(), result.toString()) @@ -103,7 +103,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { val sandboxSet = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showLongNavigableSet = classLoader.createTaskFor(taskFactory, ShowLongNavigableSet::class.java) + val showLongNavigableSet = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowLongNavigableSet::class.java) val result = showLongNavigableSet.apply(sandboxSet) ?: fail("Result cannot be null") assertEquals(longNavigableSet.numbers.joinToString(), result.toString()) @@ -128,7 +128,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { val sandboxCollection = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showShortCollection = classLoader.createTaskFor(taskFactory, ShowShortCollection::class.java) + val showShortCollection = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowShortCollection::class.java) val result = showShortCollection.apply(sandboxCollection) ?: fail("Result cannot be null") assertEquals(shortCollection.numbers.joinToString(), result.toString()) @@ -153,7 +153,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { val sandboxSet = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showNonEmptyStringSet = classLoader.createTaskFor(taskFactory, ShowNonEmptyStringSet::class.java) + val showNonEmptyStringSet = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowNonEmptyStringSet::class.java) val result = showNonEmptyStringSet.apply(sandboxSet) ?: fail("Result cannot be null") assertEquals(nonEmptyStrings.lines.joinToString(), result.toString()) @@ -178,7 +178,7 @@ class DeserializeCollectionsTest : TestBase(KOTLIN) { val sandboxSet = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showHasEnumSet = classLoader.createTaskFor(taskFactory, ShowHasEnumSet::class.java) + val showHasEnumSet = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowHasEnumSet::class.java) val result = showHasEnumSet.apply(sandboxSet) ?: fail("Result cannot be null") assertEquals(enumSet.values.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeComposedCustomDataTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeComposedCustomDataTest.kt index 07e1f75e7a..eb9d80dacd 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeComposedCustomDataTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeComposedCustomDataTest.kt @@ -51,7 +51,7 @@ class DeserializeComposedCustomDataTest: TestBase(KOTLIN) { val sandboxComplex = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showComplex = classLoader.createTaskFor(taskFactory, ShowComposedData::class.java) + val showComplex = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowComposedData::class.java) val result = showComplex.apply(sandboxComplex) ?: fail("Result cannot be null") assertEquals(SANDBOX_STRING, result::class.java.name) assertEquals(ShowComposedData().apply(composed), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCurrencyTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCurrencyTest.kt index e27b015da9..c8bc86fbea 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCurrencyTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCurrencyTest.kt @@ -24,7 +24,7 @@ class DeserializeCurrencyTest : TestBase(KOTLIN) { val sandboxCurrency = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showCurrency = classLoader.createTaskFor(taskFactory, ShowCurrency::class.java) + val showCurrency = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowCurrency::class.java) val result = showCurrency.apply(sandboxCurrency) ?: fail("Result cannot be null") assertEquals(ShowCurrency().apply(currency), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCustomGenericDataTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCustomGenericDataTest.kt index fc51d0ecc5..7e1acff623 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCustomGenericDataTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeCustomGenericDataTest.kt @@ -46,7 +46,7 @@ class DeserializeCustomGenericDataTest: TestBase(KOTLIN) { val sandboxComplex = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showComplex = classLoader.createTaskFor(taskFactory, ShowComplexData::class.java) + val showComplex = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowComplexData::class.java) val result = showComplex.apply(sandboxComplex) ?: fail("Result cannot be null") assertEquals(SANDBOX_STRING, result::class.java.name) assertEquals(ShowComplexData().apply(complex), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeEnumSetTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeEnumSetTest.kt index 5d8b1d6ccb..22681c44f5 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeEnumSetTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeEnumSetTest.kt @@ -26,7 +26,7 @@ class DeserializeEnumSetTest : TestBase(KOTLIN) { val sandboxEnumSet = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showEnumSet = classLoader.createTaskFor(taskFactory, ShowEnumSet::class.java) + val showEnumSet = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowEnumSet::class.java) val result = showEnumSet.apply(sandboxEnumSet) ?: fail("Result cannot be null") assertEquals(ShowEnumSet().apply(enumSet), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeEnumTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeEnumTest.kt index c110ea96d7..2dbbb2ea16 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeEnumTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeEnumTest.kt @@ -25,7 +25,7 @@ class DeserializeEnumTest : TestBase(KOTLIN) { val sandboxExample = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showExampleData = classLoader.createTaskFor(taskFactory, ShowExampleData::class.java) + val showExampleData = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowExampleData::class.java) val result = showExampleData.apply(sandboxExample) ?: fail("Result cannot be null") assertEquals(ShowExampleData().apply(example), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeGenericsTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeGenericsTest.kt index 84fce6e9fd..0a2f9e2fd8 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeGenericsTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeGenericsTest.kt @@ -24,7 +24,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { val sandboxWrapper = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val getGenericData = classLoader.createTaskFor(taskFactory, GetGenericData::class.java) + val getGenericData = taskFactory.compose(classLoader.createSandboxFunction()).apply(GetGenericData::class.java) val result = getGenericData.apply(sandboxWrapper) ?: fail("Result cannot be null") assertEquals("Hello World!", result.toString()) @@ -43,7 +43,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { val sandboxWrapper = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val getGenericData = classLoader.createTaskFor(taskFactory, GetGenericData::class.java) + val getGenericData = taskFactory.compose(classLoader.createSandboxFunction()).apply(GetGenericData::class.java) val result = getGenericData.apply(sandboxWrapper) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Integer", result::class.java.name) @@ -62,7 +62,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { val sandboxWrapper = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val getGenericData = classLoader.createTaskFor(taskFactory, GetGenericData::class.java) + val getGenericData = taskFactory.compose(classLoader.createSandboxFunction()).apply(GetGenericData::class.java) val result = getGenericData.apply(sandboxWrapper) ?: fail("Result cannot be null") assertEquals("[Lsandbox.java.lang.Integer;", result::class.java.name) @@ -82,7 +82,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { val sandboxWrapper = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val getGenericData = classLoader.createTaskFor(taskFactory, GetGenericData::class.java) + val getGenericData = taskFactory.compose(classLoader.createSandboxFunction()).apply(GetGenericData::class.java) val result = getGenericData.apply(sandboxWrapper) ?: fail("Result cannot be null") assertEquals("[I", result::class.java.name) @@ -102,13 +102,14 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { val sandboxWrapper = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val getGenericData = classLoader.createTaskFor(taskFactory, GetGenericData::class.java) + val sandboxFunction = classLoader.createSandboxFunction() + val getGenericData = taskFactory.compose(sandboxFunction).apply(GetGenericData::class.java) val dataResult = getGenericData.apply(sandboxWrapper) ?: fail("Result cannot be null") assertEquals("[Hello World!]", dataResult.toString()) assertEquals("sandbox.java.util.Collections\$UnmodifiableRandomAccessList", dataResult::class.java.name) - val getGenericIterableData = classLoader.createTaskFor(taskFactory, GetGenericIterableData::class.java) + val getGenericIterableData = taskFactory.compose(sandboxFunction).apply(GetGenericIterableData::class.java) val dataItemResult = getGenericIterableData.apply(sandboxWrapper) ?: fail("Result cannot be null") assertEquals(SANDBOX_STRING, dataItemResult::class.java.name) } @@ -146,7 +147,7 @@ class DeserializeGenericsTest : TestBase(KOTLIN) { val sandboxWrapped = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showConcreteWrapper = classLoader.createTaskFor(taskFactory, ShowConcreteWrapper::class.java) + val showConcreteWrapper = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowConcreteWrapper::class.java) val result = showConcreteWrapper.apply(sandboxWrapped) ?: fail("Result cannot be null") assertEquals("Concrete: first='Hello World', second='!'", result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInputStreamTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInputStreamTest.kt index 5a4d096316..2194729c27 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInputStreamTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInputStreamTest.kt @@ -27,7 +27,7 @@ class DeserializeInputStreamTest : TestBase(KOTLIN) { val sandboxStream = data.deserializeTypeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showInputStream = classLoader.createTaskFor(taskFactory, ShowInputStream::class.java) + val showInputStream = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowInputStream::class.java) val result = showInputStream.apply(sandboxStream) ?: fail("Result cannot be null") assertEquals(String(MESSAGE.byteInputStream().readFully()), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInstantTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInstantTest.kt index d0330bd999..d4ff0aec42 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInstantTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeInstantTest.kt @@ -23,7 +23,7 @@ class DeserializeInstantTest : TestBase(KOTLIN) { val sandboxInstant = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showInstant = classLoader.createTaskFor(taskFactory, ShowInstant::class.java) + val showInstant = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowInstant::class.java) val result = showInstant.apply(sandboxInstant) ?: fail("Result cannot be null") assertEquals(instant.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeJavaWithMultipleConstructorsTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeJavaWithMultipleConstructorsTest.kt index c755f7381e..a149adcc79 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeJavaWithMultipleConstructorsTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeJavaWithMultipleConstructorsTest.kt @@ -23,7 +23,7 @@ class DeserializeJavaWithMultipleConstructorsTest : TestBase(KOTLIN) { val sandboxData = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showMultiData = classLoader.createTaskFor(taskFactory, ShowMultiData::class.java) + val showMultiData = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowMultiData::class.java) val result = showMultiData.apply(sandboxData) ?: fail("Result cannot be null") assertThat(result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeKotlinAliasTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeKotlinAliasTest.kt index 420efb5ed1..c93e016316 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeKotlinAliasTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeKotlinAliasTest.kt @@ -25,7 +25,7 @@ class DeserializeKotlinAliasTest : TestBase(KOTLIN) { val sandboxAttachmentId = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showAlias = classLoader.createTaskFor(taskFactory, ShowAlias::class.java) + val showAlias = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowAlias::class.java) val result = showAlias.apply(sandboxAttachmentId) ?: fail("Result cannot be null") assertEquals(ShowAlias().apply(attachmentId), result.toString()) @@ -50,7 +50,7 @@ class DeserializeKotlinAliasTest : TestBase(KOTLIN) { val sandboxAttachment = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showAliasData = classLoader.createTaskFor(taskFactory, ShowAliasData::class.java) + val showAliasData = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowAliasData::class.java) val result = showAliasData.apply(sandboxAttachment) ?: fail("Result cannot be null") assertEquals(ShowAliasData().apply(attachment), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTest.kt index 4f416bb403..db5b77bfef 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTest.kt @@ -23,7 +23,7 @@ class DeserializeLocalDateTest : TestBase(KOTLIN) { val sandboxDate = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showLocalDate = classLoader.createTaskFor(taskFactory, ShowLocalDate::class.java) + val showLocalDate = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowLocalDate::class.java) val result = showLocalDate.apply(sandboxDate) ?: fail("Result cannot be null") assertEquals(date.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTimeTest.kt index b2077f1eb4..571e7f8636 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalDateTimeTest.kt @@ -23,7 +23,7 @@ class DeserializeLocalDateTimeTest : TestBase(KOTLIN) { val sandboxDateTime = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showLocalDateTime = classLoader.createTaskFor(taskFactory, ShowLocalDateTime::class.java) + val showLocalDateTime = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowLocalDateTime::class.java) val result = showLocalDateTime.apply( sandboxDateTime) ?: fail("Result cannot be null") assertEquals(dateTime.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalTimeTest.kt index d8ba1d28b0..343c4c58aa 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeLocalTimeTest.kt @@ -23,7 +23,7 @@ class DeserializeLocalTimeTest : TestBase(KOTLIN) { val sandboxTime = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showLocalTime = classLoader.createTaskFor(taskFactory, ShowLocalTime::class.java) + val showLocalTime = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowLocalTime::class.java) val result = showLocalTime.apply(sandboxTime) ?: fail("Result cannot be null") assertEquals(time.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMapsTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMapsTest.kt index 75885c9659..4e22fcccda 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMapsTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMapsTest.kt @@ -27,7 +27,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { val sandboxMap = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringMap = classLoader.createTaskFor(taskFactory, ShowStringMap::class.java) + val showStringMap = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowStringMap::class.java) val result = showStringMap.apply(sandboxMap) ?: fail("Result cannot be null") assertEquals(stringMap.values.entries.joinToString(), result.toString()) @@ -56,7 +56,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { val sandboxMap = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringSortedMap = classLoader.createTaskFor(taskFactory, ShowStringSortedMap::class.java) + val showStringSortedMap = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowStringSortedMap::class.java) val result = showStringSortedMap.apply(sandboxMap) ?: fail("Result cannot be null") assertEquals(sortedMap.values.entries.joinToString(), result.toString()) @@ -85,7 +85,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { val sandboxMap = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringNavigableMap = classLoader.createTaskFor(taskFactory, ShowStringNavigableMap::class.java) + val showStringNavigableMap = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowStringNavigableMap::class.java) val result = showStringNavigableMap.apply(sandboxMap) ?: fail("Result cannot be null") assertEquals(navigableMap.values.entries.joinToString(), result.toString()) @@ -114,7 +114,8 @@ class DeserializeMapsTest : TestBase(KOTLIN) { val sandboxMap = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringLinkedHashMap = classLoader.createTaskFor(taskFactory, ShowStringLinkedHashMap::class.java) + val sandboxFunction = classLoader.createSandboxFunction() + val showStringLinkedHashMap = taskFactory.compose(sandboxFunction).apply(ShowStringLinkedHashMap::class.java) val result = showStringLinkedHashMap.apply(sandboxMap) ?: fail("Result cannot be null") assertEquals(linkedHashMap.values.entries.joinToString(), result.toString()) @@ -143,7 +144,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { val sandboxMap = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringTreeMap = classLoader.createTaskFor(taskFactory, ShowStringTreeMap::class.java) + val showStringTreeMap = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowStringTreeMap::class.java) val result = showStringTreeMap.apply(sandboxMap) ?: fail("Result cannot be null") assertEquals(treeMap.values.entries.joinToString(), result.toString()) @@ -171,7 +172,7 @@ class DeserializeMapsTest : TestBase(KOTLIN) { val sandboxMap = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showEnumMap = classLoader.createTaskFor(taskFactory, ShowEnumMap::class.java) + val showEnumMap = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowEnumMap::class.java) val result = showEnumMap.apply(sandboxMap) ?: fail("Result cannot be null") assertEquals(enumMap.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMonthDayTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMonthDayTest.kt index 425a289cb5..f3f5cde387 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMonthDayTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeMonthDayTest.kt @@ -23,7 +23,7 @@ class DeserializeMonthDayTest : TestBase(KOTLIN) { val sandboxMonthDay = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showMonthDay = classLoader.createTaskFor(taskFactory, ShowMonthDay::class.java) + val showMonthDay = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowMonthDay::class.java) val result = showMonthDay.apply(sandboxMonthDay) ?: fail("Result cannot be null") assertEquals(monthDay.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeObjectArraysTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeObjectArraysTest.kt index 835e62a8c4..92fe9c8729 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeObjectArraysTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeObjectArraysTest.kt @@ -25,7 +25,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringArray = classLoader.createTaskFor(taskFactory, ShowStringArray::class.java) + val showStringArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowStringArray::class.java) val result = showStringArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals(SANDBOX_STRING, result::class.java.name) @@ -51,7 +51,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showCharacterArray = classLoader.createTaskFor(taskFactory, ShowCharacterArray::class.java) + val showCharacterArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowCharacterArray::class.java) val result = showCharacterArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals(SANDBOX_STRING, result::class.java.name) @@ -76,7 +76,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showLongArray = classLoader.createTaskFor(taskFactory, ShowLongArray::class.java) + val showLongArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowLongArray::class.java) val result = showLongArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Long", result::class.java.name) @@ -101,7 +101,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showIntegerArray = classLoader.createTaskFor(taskFactory, ShowIntegerArray::class.java) + val showIntegerArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowIntegerArray::class.java) val result = showIntegerArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Integer", result::class.java.name) @@ -126,7 +126,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showShortArray = classLoader.createTaskFor(taskFactory, ShowShortArray::class.java) + val showShortArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowShortArray::class.java) val result = showShortArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Integer", result::class.java.name) @@ -151,7 +151,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showByteArray = classLoader.createTaskFor(taskFactory, ShowByteArray::class.java) + val showByteArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowByteArray::class.java) val result = showByteArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Integer", result::class.java.name) @@ -176,7 +176,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showDoubleArray = classLoader.createTaskFor(taskFactory, ShowDoubleArray::class.java) + val showDoubleArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowDoubleArray::class.java) val result = showDoubleArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Double", result::class.java.name) @@ -201,7 +201,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showFloatArray = classLoader.createTaskFor(taskFactory, ShowFloatArray::class.java) + val showFloatArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowFloatArray::class.java) val result = showFloatArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Float", result::class.java.name) @@ -226,7 +226,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showBooleanArray = classLoader.createTaskFor(taskFactory, ShowBooleanArray::class.java) + val showBooleanArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowBooleanArray::class.java) val result = showBooleanArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Boolean", result::class.java.name) @@ -252,7 +252,7 @@ class DeserializeObjectArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showUUIDArray = classLoader.createTaskFor(taskFactory, ShowUUIDArray::class.java) + val showUUIDArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowUUIDArray::class.java) val result = showUUIDArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals(SANDBOX_STRING, result::class.java.name) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetDateTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetDateTimeTest.kt index c8b6aa6af9..e8b210c81b 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetDateTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetDateTimeTest.kt @@ -23,7 +23,7 @@ class DeserializeOffsetDateTimeTest : TestBase(KOTLIN) { val sandboxDateTime = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showOffsetDateTime = classLoader.createTaskFor(taskFactory, ShowOffsetDateTime::class.java) + val showOffsetDateTime = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowOffsetDateTime::class.java) val result = showOffsetDateTime.apply(sandboxDateTime) ?: fail("Result cannot be null") assertEquals(dateTime.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetTimeTest.kt index 2829f11259..f8cedabc23 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOffsetTimeTest.kt @@ -23,7 +23,7 @@ class DeserializeOffsetTimeTest : TestBase(KOTLIN) { val sandboxTime = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showOffsetTime = classLoader.createTaskFor(taskFactory, ShowOffsetTime::class.java) + val showOffsetTime = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowOffsetTime::class.java) val result = showOffsetTime.apply(sandboxTime) ?: fail("Result cannot be null") assertEquals(time.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOpaqueBytesSubSequenceTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOpaqueBytesSubSequenceTest.kt index 0ff0a0deca..456191706c 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOpaqueBytesSubSequenceTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOpaqueBytesSubSequenceTest.kt @@ -32,7 +32,8 @@ class DeserializeOpaqueBytesSubSequenceTest : TestBase(KOTLIN) { val sandboxBytes = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showOpaqueBytesSubSequence = classLoader.createTaskFor(taskFactory, ShowOpaqueBytesSubSequence::class.java) + val sandboxFunction = classLoader.createSandboxFunction() + val showOpaqueBytesSubSequence = taskFactory.compose(sandboxFunction).apply(ShowOpaqueBytesSubSequence::class.java) val result = showOpaqueBytesSubSequence.apply(sandboxBytes) ?: fail("Result cannot be null") assertEquals(MESSAGE.substring(OFFSET), String(result as ByteArray)) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOptionalTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOptionalTest.kt index 5914d75dac..7f98cb228e 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOptionalTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeOptionalTest.kt @@ -23,7 +23,7 @@ class DeserializeOptionalTest : TestBase(KOTLIN) { val sandboxOptional = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showOptional = classLoader.createTaskFor(taskFactory, ShowOptional::class.java) + val showOptional = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowOptional::class.java) val result = showOptional.apply(sandboxOptional) ?: fail("Result cannot be null") assertEquals("Optional -> Optional[Hello World!]", result.toString()) @@ -42,7 +42,7 @@ class DeserializeOptionalTest : TestBase(KOTLIN) { val sandboxOptional = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showOptional = classLoader.createTaskFor(taskFactory, ShowOptional::class.java) + val showOptional = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowOptional::class.java) val result = showOptional.apply(sandboxOptional) ?: fail("Result cannot be null") assertEquals("Optional -> Optional.empty", result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePeriodTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePeriodTest.kt index 372a9b473a..7253009d70 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePeriodTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePeriodTest.kt @@ -23,7 +23,7 @@ class DeserializePeriodTest : TestBase(KOTLIN) { val sandboxPeriod = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showPeriod = classLoader.createTaskFor(taskFactory, ShowPeriod::class.java) + val showPeriod = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowPeriod::class.java) val result = showPeriod.apply(sandboxPeriod) ?: fail("Result cannot be null") assertEquals(period.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitiveArraysTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitiveArraysTest.kt index 7a7530982d..2b006d79ba 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitiveArraysTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePrimitiveArraysTest.kt @@ -24,7 +24,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showCharArray = classLoader.createTaskFor(taskFactory, ShowCharArray::class.java) + val showCharArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowCharArray::class.java) val result = showCharArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals(SANDBOX_STRING, result::class.java.name) @@ -49,7 +49,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showIntegerArray = classLoader.createTaskFor(taskFactory, ShowIntegerArray::class.java) + val showIntegerArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowIntegerArray::class.java) val result = showIntegerArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Integer", result::class.java.name) @@ -74,7 +74,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showLongArray = classLoader.createTaskFor(taskFactory, ShowLongArray::class.java) + val showLongArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowLongArray::class.java) val result = showLongArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Long", result::class.java.name) @@ -99,7 +99,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showShortArray = classLoader.createTaskFor(taskFactory, ShowShortArray::class.java) + val showShortArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowShortArray::class.java) val result = showShortArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Integer", result::class.java.name) @@ -124,7 +124,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showByteArray = classLoader.createTaskFor(taskFactory, ShowByteArray::class.java) + val showByteArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowByteArray::class.java) val result = showByteArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Integer", result::class.java.name) @@ -149,7 +149,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showBooleanArray = classLoader.createTaskFor(taskFactory, ShowBooleanArray::class.java) + val showBooleanArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowBooleanArray::class.java) val result = showBooleanArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Boolean", result::class.java.name) @@ -174,7 +174,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showDoubleArray = classLoader.createTaskFor(taskFactory, ShowDoubleArray::class.java) + val showDoubleArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowDoubleArray::class.java) val result = showDoubleArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Double", result::class.java.name) @@ -199,7 +199,7 @@ class DeserializePrimitiveArraysTest : TestBase(KOTLIN) { val sandboxArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showFloatArray = classLoader.createTaskFor(taskFactory, ShowFloatArray::class.java) + val showFloatArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowFloatArray::class.java) val result = showFloatArray.apply(sandboxArray) ?: fail("Result cannot be null") assertEquals("sandbox.java.lang.Float", result::class.java.name) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeProtonJTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeProtonJTest.kt index a73b7a8ddc..79a9dae097 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeProtonJTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeProtonJTest.kt @@ -32,7 +32,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { val sandboxProtonJ = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showUnsignedLong = classLoader.createTaskFor(taskFactory, ShowUnsignedLong::class.java) + val showUnsignedLong = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowUnsignedLong::class.java) val result = showUnsignedLong.apply(sandboxProtonJ) ?: fail("Result cannot be null") assertEquals(protonJ.number.toString(), result.toString()) @@ -57,7 +57,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { val sandboxProtonJ = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showUnsignedInteger = classLoader.createTaskFor(taskFactory, ShowUnsignedInteger::class.java) + val showUnsignedInteger = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowUnsignedInteger::class.java) val result = showUnsignedInteger.apply(sandboxProtonJ) ?: fail("Result cannot be null") assertEquals(protonJ.number.toString(), result.toString()) @@ -82,7 +82,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { val sandboxProtonJ = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showUnsignedShort = classLoader.createTaskFor(taskFactory, ShowUnsignedShort::class.java) + val showUnsignedShort = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowUnsignedShort::class.java) val result = showUnsignedShort.apply(sandboxProtonJ) ?: fail("Result cannot be null") assertEquals(protonJ.number.toString(), result.toString()) @@ -107,7 +107,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { val sandboxProtonJ = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showUnsignedByte = classLoader.createTaskFor(taskFactory, ShowUnsignedByte::class.java) + val showUnsignedByte = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowUnsignedByte::class.java) val result = showUnsignedByte.apply(sandboxProtonJ) ?: fail("Result cannot be null") assertEquals(protonJ.number.toString(), result.toString()) @@ -132,7 +132,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { val sandboxProtonJ = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showDecimal128 = classLoader.createTaskFor(taskFactory, ShowDecimal128::class.java) + val showDecimal128 = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowDecimal128::class.java) val result = showDecimal128.apply(sandboxProtonJ) ?: fail("Result cannot be null") assertThat(result) @@ -157,7 +157,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { val sandboxProtonJ = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showDecimal64 = classLoader.createTaskFor(taskFactory, ShowDecimal64::class.java) + val showDecimal64 = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowDecimal64::class.java) val result = showDecimal64.apply(sandboxProtonJ) ?: fail("Result cannot be null") assertEquals(protonJ.number.bits.toString(), result.toString()) @@ -181,7 +181,7 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { val sandboxProtonJ = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showDecimal32 = classLoader.createTaskFor(taskFactory, ShowDecimal32::class.java) + val showDecimal32 = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowDecimal32::class.java) val result = showDecimal32.apply(sandboxProtonJ) ?: fail("Result cannot be null") assertEquals(protonJ.number.bits.toString(), result.toString()) @@ -204,9 +204,9 @@ class DeserializeProtonJTest : TestBase(KOTLIN) { val sandboxProtonJ = data.deserializeFor(classLoader) - val executor = classLoader.createRawTaskFactory() - val taskFactory = classLoader.createTaskFor(executor, ShowSymbol::class.java) - val result = taskFactory.apply(sandboxProtonJ) ?: fail("Result cannot be null") + val taskFactory = classLoader.createRawTaskFactory() + val showSymbol = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowSymbol::class.java) + val result = showSymbol.apply(sandboxProtonJ) ?: fail("Result cannot be null") assertEquals(protonJ.symbol.toString(), result.toString()) assertEquals(SANDBOX_STRING, result::class.java.name) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePublicKeyTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePublicKeyTest.kt index 26bc1c700f..2880fcf493 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePublicKeyTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializePublicKeyTest.kt @@ -44,7 +44,7 @@ class DeserializePublicKeyTest : TestBase(KOTLIN) { val sandboxKey = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showPublicKey = classLoader.createTaskFor(taskFactory, ShowPublicKey::class.java) + val showPublicKey = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowPublicKey::class.java) val result = showPublicKey.apply(sandboxKey) ?: fail("Result cannot be null") assertEquals(ShowPublicKey().apply(publicKey), result.toString()) @@ -72,7 +72,7 @@ class DeserializePublicKeyTest : TestBase(KOTLIN) { val sandboxKey = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showPublicKey = classLoader.createTaskFor(taskFactory, ShowPublicKey::class.java) + val showPublicKey = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowPublicKey::class.java) val result = showPublicKey.apply(sandboxKey) ?: fail("Result cannot be null") assertEquals(ShowPublicKey().apply(compositeData), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringBufferTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringBufferTest.kt index 5783c96c27..de67313356 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringBufferTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringBufferTest.kt @@ -22,7 +22,7 @@ class DeserializeStringBufferTest : TestBase(KOTLIN) { val sandboxBuffer = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringBuffer = classLoader.createTaskFor(taskFactory, ShowStringBuffer::class.java) + val showStringBuffer = taskFactory.compose(classLoader.createSandboxFunction()).apply( ShowStringBuffer::class.java) val result = showStringBuffer.apply(sandboxBuffer) ?: fail("Result cannot be null") assertEquals(ShowStringBuffer().apply(buffer), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringTest.kt index 7d39212e2d..e5970270b9 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeStringTest.kt @@ -23,7 +23,7 @@ class DeserializeStringTest : TestBase(KOTLIN) { val sandboxString = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringMessage = classLoader.createTaskFor(taskFactory, ShowStringMessage::class.java) + val showStringMessage = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowStringMessage::class.java) val result = showStringMessage.apply(sandboxString) ?: fail("Result cannot be null") assertEquals(stringMessage.message, result.toString()) @@ -50,7 +50,7 @@ class DeserializeStringTest : TestBase(KOTLIN) { val sandboxListArray = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showStringListOfArray = classLoader.createTaskFor(taskFactory, ShowStringListOfArray::class.java) + val showStringListOfArray = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowStringListOfArray::class.java) val result = showStringListOfArray.apply(sandboxListArray) ?: fail("Result cannot be null") assertEquals(stringListArray.data.flatMap(Array::toList).joinToString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithCustomSerializerTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithCustomSerializerTest.kt index 2b2d0cf82e..ff7ec49034 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithCustomSerializerTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithCustomSerializerTest.kt @@ -44,7 +44,7 @@ class DeserializeWithCustomSerializerTest: TestBase(KOTLIN) { val sandboxCustom = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showCustom = classLoader.createTaskFor(taskFactory, ShowCustomData::class.java) + val showCustom = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowCustomData::class.java) val result = showCustom.apply(sandboxCustom) ?: fail("Result cannot be null") assertEquals(custom.value, result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithObjectCustomSerializerTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithObjectCustomSerializerTest.kt index f913d166cd..06be0e5d39 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithObjectCustomSerializerTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithObjectCustomSerializerTest.kt @@ -42,7 +42,7 @@ class DeserializeWithObjectCustomSerializerTest: TestBase(KOTLIN) { val sandboxCustom = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showCustom = classLoader.createTaskFor(taskFactory, ShowCustomData::class.java) + val showCustom = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowCustomData::class.java) val result = showCustom.apply(sandboxCustom) ?: fail("Result cannot be null") assertEquals(custom.value, result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithSerializationWhitelistTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithSerializationWhitelistTest.kt index 18c91b47a6..4f8811fba6 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithSerializationWhitelistTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeWithSerializationWhitelistTest.kt @@ -45,7 +45,7 @@ class DeserializeWithSerializationWhitelistTest: TestBase(KOTLIN) { val sandboxCustom = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showCustom = classLoader.createTaskFor(taskFactory, ShowCustomData::class.java) + val showCustom = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowCustomData::class.java) val result = showCustom.apply(sandboxCustom) ?: fail("Result cannot be null") assertEquals(custom.value, result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearMonthTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearMonthTest.kt index a8f87315c2..97b6dfc881 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearMonthTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearMonthTest.kt @@ -23,7 +23,7 @@ class DeserializeYearMonthTest : TestBase(KOTLIN) { val sandboxYearMonth = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showYearMonth = classLoader.createTaskFor(taskFactory, ShowYearMonth::class.java) + val showYearMonth = taskFactory.compose(classLoader.createSandboxFunction()).apply( ShowYearMonth::class.java) val result = showYearMonth.apply(sandboxYearMonth) ?: fail("Result cannot be null") assertEquals(yearMonth.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearTest.kt index ce282a3e33..ed08048074 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeYearTest.kt @@ -23,7 +23,7 @@ class DeserializeYearTest : TestBase(KOTLIN) { val sandboxYear = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showYear = classLoader.createTaskFor(taskFactory, ShowYear::class.java) + val showYear = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowYear::class.java) val result = showYear.apply(sandboxYear) ?: fail("Result cannot be null") assertEquals(year.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZoneIdTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZoneIdTest.kt index 5f29e943e7..fbbd937328 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZoneIdTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZoneIdTest.kt @@ -35,7 +35,7 @@ class DeserializeZoneIdTest : TestBase(KOTLIN) { val sandboxZoneId = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showZoneId = classLoader.createTaskFor(taskFactory, ShowZoneId::class.java) + val showZoneId = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowZoneId::class.java) val result = showZoneId.apply(sandboxZoneId) ?: fail("Result cannot be null") assertEquals(zoneId.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZonedDateTimeTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZonedDateTimeTest.kt index 8bb463d788..0c3f2bce75 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZonedDateTimeTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/DeserializeZonedDateTimeTest.kt @@ -23,7 +23,7 @@ class DeserializeZonedDateTimeTest : TestBase(KOTLIN) { val sandboxDateTime = data.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showZonedDateTime = classLoader.createTaskFor(taskFactory, ShowZonedDateTime::class.java) + val showZonedDateTime = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowZonedDateTime::class.java) val result = showZonedDateTime.apply(sandboxDateTime) ?: fail("Result cannot be null") assertEquals(dateTime.toString(), result.toString()) diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/LocalSerialization.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/LocalSerialization.kt index 91d89efc96..36042d6920 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/LocalSerialization.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/LocalSerialization.kt @@ -21,7 +21,7 @@ import org.junit.jupiter.api.extension.BeforeEachCallback import org.junit.jupiter.api.extension.ExtensionContext class LocalSerialization( - private val customSerializers: Set>, + private val customSerializers: Set>, private val serializationWhitelists: Set ) : BeforeEachCallback, AfterEachCallback { private companion object { diff --git a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/SafeDeserialisationTest.kt b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/SafeDeserialisationTest.kt index 38758201bc..28974395e5 100644 --- a/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/SafeDeserialisationTest.kt +++ b/serialization-djvm/src/test/kotlin/net/corda/serialization/djvm/SafeDeserialisationTest.kt @@ -53,7 +53,7 @@ class SafeDeserialisationTest : TestBase(KOTLIN) { val sandboxData = evilData.deserializeFor(classLoader) val taskFactory = classLoader.createRawTaskFactory() - val showInnocentData = classLoader.createTaskFor(taskFactory, ShowInnocentData::class.java) + val showInnocentData = taskFactory.compose(classLoader.createSandboxFunction()).apply(ShowInnocentData::class.java) val result = showInnocentData.apply(sandboxData) ?: fail("Result cannot be null") // Check that we have deserialised the data without instantiating the Evil class.