From babaceab5d253c293530782783997936dee299ff Mon Sep 17 00:00:00 2001 From: Adel El-Beik <48713346+adelel1@users.noreply.github.com> Date: Fri, 4 Oct 2024 11:32:20 +0100 Subject: [PATCH] =?UTF-8?q?ENT-12276:=20Exception=20now=20takes=20a=20stri?= =?UTF-8?q?ng=20not=20a=20Method=20object,=20which=20wa=E2=80=A6=20(#7834)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ENT-12276: Exception now takes a string not a Method object, which was causing problems in Jackson parsing. --- .../serialization/internal/carpenter/ClassCarpenter.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/serialization/src/main/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenter.kt b/serialization/src/main/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenter.kt index 4a3373775b..c4d0aa414e 100644 --- a/serialization/src/main/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenter.kt +++ b/serialization/src/main/kotlin/net/corda/serialization/internal/carpenter/ClassCarpenter.kt @@ -14,7 +14,6 @@ import org.objectweb.asm.Opcodes.* import org.objectweb.asm.Type import java.lang.Character.isJavaIdentifierPart import java.lang.Character.isJavaIdentifierStart -import java.lang.reflect.Method /** * Any object that implements this interface is expected to expose its own fields via the [get] method, exactly @@ -44,8 +43,8 @@ class CarpenterClassLoader(private val parentClassLoader: ClassLoader = Thread.c } } -class InterfaceMismatchNonGetterException(val clazz: Class<*>, val method: Method) : InterfaceMismatchException( - "Requested interfaces must consist only of methods that start with 'get': ${clazz.name}.${method.name}") +class InterfaceMismatchNonGetterException(val clazz: Class<*>, val methodName: String) : InterfaceMismatchException( + "Requested interfaces must consist only of methods that start with 'get': ${clazz.name}.${methodName}") class InterfaceMismatchMissingAMQPFieldException(val clazz: Class<*>, val field: String) : InterfaceMismatchException( "Interface ${clazz.name} requires a field named $field but that isn't found in the schema or any superclass schemas") @@ -459,7 +458,7 @@ class ClassCarpenterImpl @JvmOverloads constructor (override val whitelist: Clas logger.debug { "Ignoring interface $method which is not a getter" } continue@methodLoop } else { - throw InterfaceMismatchNonGetterException(itf, method) + throw InterfaceMismatchNonGetterException(itf, method.name) } // If we're trying to carpent a class that prior to serialisation / deserialization