Tidy up changes for review.

This commit is contained in:
Chris Rankin 2019-08-23 11:11:11 +01:00
parent b2d335c518
commit 4ebd02bc04
2 changed files with 14 additions and 11 deletions

View File

@ -192,7 +192,8 @@ object EvolutionPropertyWriteStrategy : PropertyWriteStrategy {
* Read a type that comes with its own [TypeDescriptor], by calling back into [RemoteSerializerFactory] to obtain a suitable
* serializer for that descriptor.
*/
class DescribedTypeReadStrategy(name: String, typeIdentifier: TypeIdentifier,
class DescribedTypeReadStrategy(name: String,
typeIdentifier: TypeIdentifier,
private val type: Type): PropertyReadStrategy {
private val nameForDebug = "$name(${typeIdentifier.prettyPrint(false)})"

View File

@ -17,16 +17,18 @@ object SerializerFactoryBuilder {
* The DJVM will need to override these, but probably not anyone else.
*/
@Suppress("unchecked_cast")
private val javaPrimitiveTypes: Map<Class<*>, Class<*>> = unmodifiableMap(mapOf<Class<out Any>?, Class<out Any>?>(
Boolean::class.javaObjectType to Boolean::class.javaPrimitiveType,
Byte::class.javaObjectType to Byte::class.javaPrimitiveType,
Char::class.javaObjectType to Char::class.javaPrimitiveType,
Double::class.javaObjectType to Double::class.javaPrimitiveType,
Float::class.javaObjectType to Float::class.javaPrimitiveType,
Int::class.javaObjectType to Int::class.javaPrimitiveType,
Long::class.javaObjectType to Long::class.javaPrimitiveType,
Short::class.javaObjectType to Short::class.javaPrimitiveType
)) as Map<Class<*>, Class<*>>
private val javaPrimitiveTypes: Map<Class<*>, Class<*>> = unmodifiableMap(listOf(
Boolean::class,
Byte::class,
Char::class,
Double::class,
Float::class,
Int::class,
Long::class,
Short::class
).associate {
klazz -> klazz.javaObjectType to klazz.javaPrimitiveType
}) as Map<Class<*>, Class<*>>
@JvmStatic
fun build(whitelist: ClassWhitelist, classCarpenter: ClassCarpenter): SerializerFactory {