From 03850dabc2956cfa7a704eb360e4c044923040c9 Mon Sep 17 00:00:00 2001 From: Kat Baker Date: Thu, 12 Apr 2018 11:58:56 +0100 Subject: [PATCH] Review comments --- docs/source/changelog.rst | 4 ++-- .../internal/serialization/amqp/SerializationHelper.kt | 2 +- .../internal/serialization/amqp/SetterConstructorTests.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 6887eab922..8d0ee6cc3e 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -7,8 +7,8 @@ release, see :doc:`upgrade-notes`. Unreleased ========== -* Fix CORDA-1229. Setter based serialization was broken with generic types when the property was stored - as the interface type, List for example. +* Fix CORDA-1229. Setter-based serialization was broken with generic types when the property was stored + as the raw type, List for example. * java.security.cert.CRLReason added to the default Whitelist. diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/SerializationHelper.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/SerializationHelper.kt index 5f92cb9ed2..119b1e0211 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/SerializationHelper.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/serialization/amqp/SerializationHelper.kt @@ -314,7 +314,7 @@ fun propertiesForSerializationFromSetters( "${property.value.field?.genericType!!}") } - // make sure the getter returns the same type (within inheritance bounds) the setter accepts + // Make sure the getter returns the same type (within inheritance bounds) the setter accepts. if (!(TypeToken.of (getter.genericReturnType).isSupertypeOf(setterType))) { throw NotSerializableException("Defined setter for parameter ${property.value.field?.name} " + "takes parameter of type $setterType yet the defined getter returns a value of type " + diff --git a/node-api/src/test/java/net/corda/nodeapi/internal/serialization/amqp/SetterConstructorTests.java b/node-api/src/test/java/net/corda/nodeapi/internal/serialization/amqp/SetterConstructorTests.java index 2c2b938ab9..2e819dfbe7 100644 --- a/node-api/src/test/java/net/corda/nodeapi/internal/serialization/amqp/SetterConstructorTests.java +++ b/node-api/src/test/java/net/corda/nodeapi/internal/serialization/amqp/SetterConstructorTests.java @@ -345,8 +345,8 @@ public class SetterConstructorTests { evolutionSerialiserGetter, fingerPrinter); - // if we've got super / sub types on the setter vs the unerlaying type the wrong way around this will - // explode + // if we've got super / sub types on the setter vs the underlying type the wrong way around this will + // explode. See CORDA-1229 (https://r3-cev.atlassian.net/browse/CORDA-1229) new SerializationOutput(factory1).serialize(cil); } }