CORDA-540: Special provisions when artificial "AnyType" is used

This commit is contained in:
Viktor Kolomeyko 2017-09-05 13:56:13 +01:00 committed by Viktor Kolomeyko
parent a01f390515
commit cac2465ea5

View File

@ -126,7 +126,7 @@ class DeserializationInput(internal val serializerFactory: SerializerFactory) {
is DescribedType -> {
// Look up serializer in factory by descriptor
val serializer = serializerFactory.get(obj.descriptor, schema)
if (serializer.type != type && with(serializer.type) { !isSubClassOf(type) && !materiallyEquivalentTo(type) })
if (SerializerFactory.AnyType != type && serializer.type != type && with(serializer.type) { !isSubClassOf(type) && !materiallyEquivalentTo(type) })
throw NotSerializableException("Described type with descriptor ${obj.descriptor} was " +
"expected to be of type $type but was ${serializer.type}")
serializer.readObject(obj.described, schema, this)