DOCS - Separate parameter names in exceptions in a clear fashion (#2577)

This commit is contained in:
Katelyn Baker 2018-02-20 16:38:47 +00:00 committed by GitHub
parent 18f81ba973
commit a223fdb8d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(