From 97e0c3c4c2a421276f90b7a0041c63e59f8e2797 Mon Sep 17 00:00:00 2001 From: Katelyn Baker Date: Wed, 19 Jul 2017 15:19:50 +0100 Subject: [PATCH] Review Comments --- .../corda/core/serialization/amqp/PropertySerializer.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/kotlin/net/corda/core/serialization/amqp/PropertySerializer.kt b/core/src/main/kotlin/net/corda/core/serialization/amqp/PropertySerializer.kt index 66f15ba7b2..0211af8541 100644 --- a/core/src/main/kotlin/net/corda/core/serialization/amqp/PropertySerializer.kt +++ b/core/src/main/kotlin/net/corda/core/serialization/amqp/PropertySerializer.kt @@ -108,9 +108,9 @@ sealed class PropertySerializer(val name: String, val readMethod: Method, val re } /** - * A property serializer for the AMQP char type, needed as a specialisation as the underlaying - * value of the character is stored in numeric ASCII form and on deserialisation requires explicit - * casting back to a char otherwise it's treated as an Integer and TypeMismatchs occur + * A property serializer for the AMQP char type, needed as a specialisation as the underlying + * value of the character is stored in numeric UTF-16 form and on deserialisation requires explicit + * casting back to a char otherwise it's treated as an Integer and a TypeMismatch occurs */ class AMQPCharPropertySerializer(name: String, readMethod: Method) : PropertySerializer(name, readMethod, Char::class.java) { @@ -119,7 +119,7 @@ sealed class PropertySerializer(val name: String, val readMethod: Method, val re override fun readProperty(obj: Any?, schema: Schema, input: DeserializationInput) = (obj as Int).toChar() override fun writeProperty(obj: Any?, data: Data, output: SerializationOutput) { - data.putObject(readMethod.invoke(obj)) + data.putChar((readMethod.invoke(obj) as Char).toInt()) } } }