v1.2.1 bugfix for methods in different classes with the same name

This commit is contained in:
Shautvast 2023-08-22 19:23:00 +02:00
parent 86aff15ee5
commit 7ccf137898
3 changed files with 2 additions and 3 deletions

View file

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.github.shautvast</groupId> <groupId>com.github.shautvast</groupId>
<artifactId>reflective</artifactId> <artifactId>reflective</artifactId>
<version>1.2.0</version> <version>1.2.1</version>
<name>reflective</name> <name>reflective</name>
<description>Reflective utils that don't use java.lang.reflect</description> <description>Reflective utils that don't use java.lang.reflect</description>

View file

@ -32,7 +32,7 @@ public class InvokerFactory {
*/ */
public static Result<AbstractInvoker> of(MetaMethod method) { public static Result<AbstractInvoker> of(MetaMethod method) {
// new ASM ClassNode with default constructor // 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)) { if (ByteClassLoader.INSTANCE.isDefined(className)) {
return getInvoker(className); return getInvoker(className);
} }

View file

@ -143,6 +143,5 @@ public class ReflectiveTest {
public void throwEx() { public void throwEx() {
throw new RuntimeException("ex"); throw new RuntimeException("ex");
} }
} }
} }