mirror of
https://github.com/corda/corda.git
synced 2025-06-13 20:58:19 +00:00
CORDA-553 - Review comments
This commit is contained in:
@ -4,7 +4,9 @@ import com.google.common.primitives.Primitives
|
|||||||
import com.google.common.reflect.TypeResolver
|
import com.google.common.reflect.TypeResolver
|
||||||
import net.corda.core.internal.uncheckedCast
|
import net.corda.core.internal.uncheckedCast
|
||||||
import net.corda.core.serialization.ClassWhitelist
|
import net.corda.core.serialization.ClassWhitelist
|
||||||
import net.corda.nodeapi.internal.serialization.carpenter.*
|
import net.corda.nodeapi.internal.serialization.carpenter.CarpenterMetaSchema
|
||||||
|
import net.corda.nodeapi.internal.serialization.carpenter.ClassCarpenter
|
||||||
|
import net.corda.nodeapi.internal.serialization.carpenter.MetaCarpenter
|
||||||
import org.apache.qpid.proton.amqp.*
|
import org.apache.qpid.proton.amqp.*
|
||||||
import java.io.NotSerializableException
|
import java.io.NotSerializableException
|
||||||
import java.lang.reflect.*
|
import java.lang.reflect.*
|
||||||
@ -13,7 +15,7 @@ import java.util.concurrent.ConcurrentHashMap
|
|||||||
import java.util.concurrent.CopyOnWriteArrayList
|
import java.util.concurrent.CopyOnWriteArrayList
|
||||||
import javax.annotation.concurrent.ThreadSafe
|
import javax.annotation.concurrent.ThreadSafe
|
||||||
|
|
||||||
data class SerializationSchemas (val schema: Schema, val transforms: TransformsSchema)
|
data class SerializationSchemas(val schema: Schema, val transforms: TransformsSchema)
|
||||||
data class FactorySchemaAndDescriptor(val schemas: SerializationSchemas, val typeDescriptor: Any)
|
data class FactorySchemaAndDescriptor(val schemas: SerializationSchemas, val typeDescriptor: Any)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,7 +46,7 @@ open class SerializerFactory(val whitelist: ClassWhitelist, cl: ClassLoader) {
|
|||||||
private fun getEvolutionSerializer(
|
private fun getEvolutionSerializer(
|
||||||
typeNotation: TypeNotation,
|
typeNotation: TypeNotation,
|
||||||
newSerializer: AMQPSerializer<Any>,
|
newSerializer: AMQPSerializer<Any>,
|
||||||
transforms : TransformsSchema ): AMQPSerializer<Any> {
|
transforms: TransformsSchema): AMQPSerializer<Any> {
|
||||||
return serializersByDescriptor.computeIfAbsent(typeNotation.descriptor.name!!) {
|
return serializersByDescriptor.computeIfAbsent(typeNotation.descriptor.name!!) {
|
||||||
when (typeNotation) {
|
when (typeNotation) {
|
||||||
is CompositeType -> EvolutionSerializer.make(typeNotation, newSerializer as ObjectSerializer, this)
|
is CompositeType -> EvolutionSerializer.make(typeNotation, newSerializer as ObjectSerializer, this)
|
||||||
|
@ -2,6 +2,7 @@ package net.corda.nodeapi.internal.serialization.amqp
|
|||||||
|
|
||||||
import net.corda.core.serialization.CordaSerializationTransformEnumDefault
|
import net.corda.core.serialization.CordaSerializationTransformEnumDefault
|
||||||
import net.corda.core.serialization.SerializedBytes
|
import net.corda.core.serialization.SerializedBytes
|
||||||
|
import net.corda.testing.common.internal.ProjectStructure.projectRootDir
|
||||||
import org.assertj.core.api.Assertions
|
import org.assertj.core.api.Assertions
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -12,7 +13,8 @@ import java.net.URI
|
|||||||
// the new ones out, then change each test to write out the serialized bytes rather than read
|
// the new ones out, then change each test to write out the serialized bytes rather than read
|
||||||
// the file.
|
// the file.
|
||||||
class EnumEvolveTests {
|
class EnumEvolveTests {
|
||||||
var localPath = "file:///path/to/corda/node-api/src/test/resources/net/corda/nodeapi/internal/serialization/amqp"
|
var localPath = projectRootDir.toUri().resolve(
|
||||||
|
"node-api/src/test/resources/net/corda/nodeapi/internal/serialization/amqp")
|
||||||
|
|
||||||
// Version of the class as it was serialised
|
// Version of the class as it was serialised
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user