Cleaned up logging for registration data

This commit is contained in:
nathan 2020-08-25 01:56:54 +02:00
parent 312cf036ed
commit ab69c21774
2 changed files with 19 additions and 10 deletions

View File

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

View File

@ -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<Array<Any>>()
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())