From b3433c2a469fae185820af8c80fa83b923115ace Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Wed, 22 Aug 2018 00:16:05 +0200 Subject: [PATCH] Minor: reformat SerializerFactory.kt --- .../internal/amqp/SerializerFactory.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/SerializerFactory.kt b/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/SerializerFactory.kt index 19c9c4a6d2..657c72d99b 100644 --- a/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/SerializerFactory.kt +++ b/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/SerializerFactory.kt @@ -145,9 +145,11 @@ open class SerializerFactory( } } Enum::class.java.isAssignableFrom(actualClass ?: declaredClass) -> { - logger.info("class=[${actualClass?.simpleName} | $declaredClass] is an enumeration " - + "declaredType=${declaredType.typeName} " - + "isEnum=${declaredType::class.java.isEnum}") + logger.trace { + "class=[${actualClass?.simpleName} | $declaredClass] is an enumeration " + + "declaredType=${declaredType.typeName} " + + "isEnum=${declaredType::class.java.isEnum}" + } serializersByType.computeIfAbsent(actualClass ?: declaredClass) { whitelist.requireWhitelisted(actualType) @@ -255,7 +257,7 @@ open class SerializerFactory( * that expects to find getters and a constructor with a parameter for each property. */ open fun register(customSerializer: CustomSerializer) { - logger.info ("action=\"Registering custom serializer\", class=\"${customSerializer.type}\"") + logger.trace("action=\"Registering custom serializer\", class=\"${customSerializer.type}\"") if (!serializersByDescriptor.containsKey(customSerializer.typeDescriptor)) { customSerializers += customSerializer serializersByDescriptor[customSerializer.typeDescriptor] = customSerializer @@ -266,7 +268,7 @@ open class SerializerFactory( } fun registerExternal(customSerializer: CorDappCustomSerializer) { - logger.info ("action=\"Registering external serializer\", class=\"${customSerializer.type}\"") + logger.trace("action=\"Registering external serializer\", class=\"${customSerializer.type}\"") if (!serializersByDescriptor.containsKey(customSerializer.typeDescriptor)) { customSerializers += customSerializer serializersByDescriptor[customSerializer.typeDescriptor] = customSerializer @@ -280,14 +282,14 @@ open class SerializerFactory( private fun processSchema(schemaAndDescriptor: FactorySchemaAndDescriptor, sentinel: Boolean = false) { val metaSchema = CarpenterMetaSchema.newInstance() for (typeNotation in schemaAndDescriptor.schemas.schema.types) { - logger.debug { "descriptor=${schemaAndDescriptor.typeDescriptor}, typeNotation=${typeNotation.name}" } + logger.trace { "descriptor=${schemaAndDescriptor.typeDescriptor}, typeNotation=${typeNotation.name}" } try { val serialiser = processSchemaEntry(typeNotation) // if we just successfully built a serializer for the type but the type fingerprint // doesn't match that of the serialised object then we are dealing with different // instance of the class, as such we need to build an EvolutionSerializer if (serialiser.typeDescriptor != typeNotation.descriptor.name) { - logger.info("typeNotation=${typeNotation.name} action=\"requires Evolution\"") + logger.trace { "typeNotation=${typeNotation.name} action=\"requires Evolution\"" } getEvolutionSerializer(typeNotation, serialiser, schemaAndDescriptor.schemas) } } catch (e: ClassNotFoundException) { @@ -296,7 +298,7 @@ open class SerializerFactory( throw e } else { - logger.info("typeNotation=\"${typeNotation.name}\" action=\"carpentry required\"") + logger.trace { "typeNotation=\"${typeNotation.name}\" action=\"carpentry required\"" } } metaSchema.buildFor(typeNotation, classloader) }