I am trying to invoke this method in Java reflectively:
public void setFoo(ArrayList foo) { this.foo = foo; }
The problem is that
The compiler warning should make you aware of the problem;
The argument of type null should explicitly be cast to Object[] for the invocation of the varargs method invoke(Object, Object...) from type Method. It could alternatively be cast to Object for a varargs invocation
You can fix it like this;
Object arg = null;
method.invoke(new FooHolder(), arg);