mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 08:39:09 +00:00
[BUGFIX] A bug where reflection method lookup did not work
RefClass#getMethod didn't work with parameters
This commit is contained in:
@@ -6,6 +6,7 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -309,10 +310,7 @@ public class RefClass extends RefModifiers {
|
||||
try {
|
||||
for (RefMethod method : getMethods()) {
|
||||
if (method.getName().equals(name)) {
|
||||
if (parameters == null) {
|
||||
return method;
|
||||
}
|
||||
if (method.getParameterTypes().equals(parameters)) {
|
||||
if (parameters == null || Arrays.equals(method.getParameterTypes(), parameters)) {
|
||||
return method;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user