Which 1s? Unless we’re also storing the array to use it later, there’s ZERO benefit! ![]()
Should we create an Object array for Method::invoke() as well? ![]()
method_1.invoke(this, "truc", count); ![]()
method_1.invoke(this, new Object[] { "truc", count });
Both Class::getMethod() & Method::invoke() got variadic args.
But you’re advocating an array for: Class::getMethod(): ![]()
method_1 = select_callback("my_method_1", this, new Class[] {String.class, int.class} );
And not for: Method::invoke()? ![]()
method_1.invoke(this, "truc", count);
Yea, for the ultra rare cases indeed. But it’s none of our cases here! ![]()