diff --git a/src/dorkbox/network/rmi/RmiUtils.kt b/src/dorkbox/network/rmi/RmiUtils.kt index 9a2e4542..033b7529 100644 --- a/src/dorkbox/network/rmi/RmiUtils.kt +++ b/src/dorkbox/network/rmi/RmiUtils.kt @@ -163,10 +163,6 @@ object RmiUtils { overwrittenMethod = getOverwriteMethodWithConnectionParam(implMethods, method) if (overwrittenMethod != null) { - logger.trace { - "Overridden method: $impl.${method.name}" - } - // still might be null! iface_OR_ImplMethodAccess = implAsmMethodAccess } @@ -207,6 +203,12 @@ object RmiUtils { cachedMethod.overriddenMethod = overwrittenMethod cachedMethods[i] = cachedMethod + + + if (overwrittenMethod != null && logger.isTraceEnabled) { + logger.trace("Overridden method: ${makeFancyMethodName(cachedMethod)}") + logger.trace(" to method: ${makeFancyMethodName(overwrittenMethod)}") + } } // force the type, because we KNOW it is ok to do so @@ -444,8 +446,8 @@ object RmiUtils { return packedInt.toUShort().toInt() } - fun makeFancyMethodName(cachedMethod: CachedMethod): String { - val parameterTypes = cachedMethod.method.parameterTypes + fun makeFancyMethodName(method: CachedMethod): String { + val parameterTypes = method.method.parameterTypes val size = parameterTypes.size val args: String = if (size == 0 || parameterTypes[size - 1] == Continuation::class.java) { "" @@ -453,13 +455,13 @@ object RmiUtils { parameterTypes.joinToString { it.simpleName } } - return "${cachedMethod.method.declaringClass.name}.${cachedMethod.method.name}($args)" + return "${method.method.declaringClass.name}.${method.method.name}($args)" } fun makeFancyMethodName(method: Method): String { val parameterTypes = method.parameterTypes val size = parameterTypes.size - val args: String = if (size != 0 || parameterTypes[size - 1] == Continuation::class.java) { + val args: String = if (size == 0 || parameterTypes[size - 1] == Continuation::class.java) { "" } else { parameterTypes.joinToString { it.simpleName } diff --git a/src/dorkbox/network/serialization/Serialization.kt b/src/dorkbox/network/serialization/Serialization.kt index 276827b7..486c6021 100644 --- a/src/dorkbox/network/serialization/Serialization.kt +++ b/src/dorkbox/network/serialization/Serialization.kt @@ -381,9 +381,16 @@ class Serialization(private val references: Boolean, // now create the registration details, used to validate that the client/server have the EXACT same class registration setup val registrationDetails = arrayListOf>() - classesToRegister.forEach { classRegistration -> - classRegistration.log(logger) + if (logger.isTraceEnabled) { + // log the in-order output first + classesToRegister.forEach { classRegistration -> + classRegistration.log(logger) + } + } + + + classesToRegister.forEach { classRegistration -> // now save all of the registration IDs for quick verification/access registrationDetails.add(classRegistration.getInfoArray())