mirror of
https://github.com/corda/corda.git
synced 2025-01-30 08:04:16 +00:00
DOCS - Separate parameter names in exceptions in a clear fashion (#2577)
This commit is contained in:
parent
18f81ba973
commit
a223fdb8d3
@ -228,7 +228,7 @@ internal fun <T : Any> 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 <T : Any> 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 <T : Any> 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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user