mirror of
https://github.com/corda/corda.git
synced 2025-01-30 16:14:39 +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.
|
// Check that the method has a getter in java.
|
||||||
val getter = matchingProperty.getter ?: throw NotSerializableException(
|
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 "
|
+ "looks anonymous, check that you have the -parameters option specified in the "
|
||||||
+ "Java compiler. Alternately, provide a proxy serializer "
|
+ "Java compiler. Alternately, provide a proxy serializer "
|
||||||
+ "(SerializationCustomSerializer) if recompiling isn't an option.")
|
+ "(SerializationCustomSerializer) if recompiling isn't an option.")
|
||||||
@ -236,15 +236,15 @@ internal fun <T : Any> propertiesForSerializationFromConstructor(
|
|||||||
val returnType = resolveTypeVariables(getter.genericReturnType, type)
|
val returnType = resolveTypeVariables(getter.genericReturnType, type)
|
||||||
if (!constructorParamTakesReturnTypeOfGetter(returnType, getter.genericReturnType, param.value)) {
|
if (!constructorParamTakesReturnTypeOfGetter(returnType, getter.genericReturnType, param.value)) {
|
||||||
throw NotSerializableException(
|
throw NotSerializableException(
|
||||||
"Property '$name' has type '$returnType' on class '$clazz' but differs from constructor " +
|
"Property - \"$name\" - has type \"$returnType\" on \"$clazz\" but differs from constructor " +
|
||||||
"parameter type '${param.value.type.javaType}'")
|
"parameter type \"${param.value.type.javaType}\"")
|
||||||
}
|
}
|
||||||
|
|
||||||
Pair(PublicPropertyReader(getter), returnType)
|
Pair(PublicPropertyReader(getter), returnType)
|
||||||
} else {
|
} else {
|
||||||
val field = classProperties[name]!!.field ?:
|
val field = classProperties[name]!!.field ?:
|
||||||
throw NotSerializableException("No property matching constructor parameter named '$name' " +
|
throw NotSerializableException("No property matching constructor parameter named - \"$name\" - " +
|
||||||
"of '$clazz'. If using Java, check that you have the -parameters option specified " +
|
"of \"$clazz\". If using Java, check that you have the -parameters option specified " +
|
||||||
"in the Java compiler. Alternately, provide a proxy serializer " +
|
"in the Java compiler. Alternately, provide a proxy serializer " +
|
||||||
"(SerializationCustomSerializer) if recompiling isn't an option")
|
"(SerializationCustomSerializer) if recompiling isn't an option")
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ internal fun <T : Any> propertiesForSerializationFromConstructor(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw NotSerializableException(
|
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(
|
this += PropertyAccessorConstructor(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user