Skip to content

Commit

Permalink
fix(params): updating the ndx parameter message behaviour logic
Browse files Browse the repository at this point in the history
  • Loading branch information
notthetup committed Aug 29, 2024
1 parent b1dd5de commit 153a616
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,18 @@ private Object invokeCompatibleSetter(String name, int ndx, Object value) throws
try {
return MethodUtils.invokeMethod(agent, name, ndx, value);
} catch (NoSuchMethodException ignored) {
// If MethodUtils.invokeMethod fails, we will try to invoke the method by
// getting the method and invoking it directly
Class<?>[] parameterTypes = new Class<?>[2];
parameterTypes[0] = Integer.TYPE;
parameterTypes[1] = value.getClass();
try {
return MethodUtils.invokeMethod(agent, name, Integer.valueOf(ndx), value);
Method m = agent.getClass().getMethod(name, parameterTypes);
return m.invoke(agent, ndx, value);
} catch (NoSuchMethodException ex) {
nsme = ex;
}
}

if (value instanceof Number) {
Number nvalue = (Number) value;
try {
Expand Down

0 comments on commit 153a616

Please sign in to comment.