From 7ccf1378984db711fbed881f4a5b2302313f8f71 Mon Sep 17 00:00:00 2001 From: Shautvast Date: Tue, 22 Aug 2023 19:23:00 +0200 Subject: [PATCH] v1.2.1 bugfix for methods in different classes with the same name --- pom.xml | 2 +- .../java/com/github/shautvast/reflective/InvokerFactory.java | 2 +- .../java/com/github/shautvast/reflective/ReflectiveTest.java | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index a4f9a54..aa6c79b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.shautvast reflective - 1.2.0 + 1.2.1 reflective Reflective utils that don't use java.lang.reflect diff --git a/src/main/java/com/github/shautvast/reflective/InvokerFactory.java b/src/main/java/com/github/shautvast/reflective/InvokerFactory.java index c120c9f..1d171c8 100644 --- a/src/main/java/com/github/shautvast/reflective/InvokerFactory.java +++ b/src/main/java/com/github/shautvast/reflective/InvokerFactory.java @@ -32,7 +32,7 @@ public class InvokerFactory { */ public static Result of(MetaMethod method) { // new ASM ClassNode with default constructor - String className = "Invoker" + method.getName() + method.getDescriptor().replaceAll("[()/;\\[]", ""); + String className = "Invoker" + method.getMetaClass().getJavaClass().getSimpleName() + method.getName() + method.getDescriptor().replaceAll("[()/;\\[]", ""); if (ByteClassLoader.INSTANCE.isDefined(className)) { return getInvoker(className); } diff --git a/src/test/java/com/github/shautvast/reflective/ReflectiveTest.java b/src/test/java/com/github/shautvast/reflective/ReflectiveTest.java index 5a32924..8604957 100644 --- a/src/test/java/com/github/shautvast/reflective/ReflectiveTest.java +++ b/src/test/java/com/github/shautvast/reflective/ReflectiveTest.java @@ -143,6 +143,5 @@ public class ReflectiveTest { public void throwEx() { throw new RuntimeException("ex"); } - } }