-
-
Notifications
You must be signed in to change notification settings - Fork 705
getMethodParamNames returns names of local variables #256
Copy link
Copy link
Closed
Description
Hello, first of all thank you for providing this great library as Open-Source software!
I tried using getMethodParamNames today, but the returned list contains not only the names of the method parameters, but also the names of the local variables of that method.
I wrote up a quick demonstration to show this:
public void test(String testParam) {
String testLocal = "local";
}
public static void main(String[] args) throws Exception {
final Method method = Demo.class.getMethod("test", String.class);
Reflections reflections = new Reflections("de.nikos410", new MethodParameterNamesScanner());
List<String> paramNames = reflections.getMethodParamNames(method);
System.out.println(paramNames);
}
The output I get is [testParam, testLocal]
Is this a known issue or is it maybe caused by some configuŕation issue?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels