From 3fe2aa24b6b8f5499b427b21c2420ca0ca162d61 Mon Sep 17 00:00:00 2001 From: Katelyn Baker Date: Tue, 20 Feb 2018 15:37:21 +0000 Subject: [PATCH] DOCS - Separate parameter names in exceptions in a clear fashion (#2578) --- .../serialization/amqp/SerializationHelper.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 c9f41fcf22..83e3486d5a 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 @@ -228,7 +228,7 @@ internal fun propertiesForSerializationFromConstructor( // Check that the method has a getter in java. val getter = matchingProperty.getter ?: throw NotSerializableException( - "Property has no getter method for $name of $clazz. If using Java and the parameter name" + "Property has no getter method for - \"$name\" - of \"$clazz\". If using Java and the parameter name" + "looks anonymous, check that you have the -parameters option specified in the " + "Java compiler. Alternately, provide a proxy serializer " + "(SerializationCustomSerializer) if recompiling isn't an option.") @@ -236,15 +236,15 @@ internal fun propertiesForSerializationFromConstructor( val returnType = resolveTypeVariables(getter.genericReturnType, type) if (!constructorParamTakesReturnTypeOfGetter(returnType, getter.genericReturnType, param.value)) { throw NotSerializableException( - "Property '$name' has type '$returnType' on class '$clazz' but differs from constructor " + - "parameter type '${param.value.type.javaType}'") + "Property - \"$name\" - has type \"$returnType\" on \"$clazz\" but differs from constructor " + + "parameter type \"${param.value.type.javaType}\"") } Pair(PublicPropertyReader(getter), returnType) } else { val field = classProperties[name]!!.field ?: - throw NotSerializableException("No property matching constructor parameter named '$name' " + - "of '$clazz'. If using Java, check that you have the -parameters option specified " + + throw NotSerializableException("No property matching constructor parameter named - \"$name\" - " + + "of \"$clazz\". If using Java, check that you have the -parameters option specified " + "in the Java compiler. Alternately, provide a proxy serializer " + "(SerializationCustomSerializer) if recompiling isn't an option") @@ -252,7 +252,7 @@ internal fun propertiesForSerializationFromConstructor( } } else { throw NotSerializableException( - "Constructor parameter $name doesn't refer to a property of class '$clazz'") + "Constructor parameter - \"$name\" - doesn't refer to a property of \"$clazz\"") } this += PropertyAccessorConstructor(