beanshell2
beanshell2 copied to clipboard
add varargs
Java now supports variable numbers of arguments. BeanShell should too.
For example:
List list(Object... objs) {
return new ArrayList(Arrays.asList(objs));
}
In keeping with BeanShell allowing types to be left out, we should also allow:
list(... objs) {
return new ArrayList(Arrays.asList(objs));
}
Original issue reported on code.google.com by [email protected] on 9 May 2007 at 2:16
Variable arguments were hacked in to 2.0b4:
http://www.nabble.com/Support-of-varargs,-an-example-t3275553.html
Original comment by [email protected] on 9 May 2007 at 5:54
I added support for calling vararg java methods, but you still can't declare
varargs
in beanshell.
Original comment by [email protected] on 29 Mar 2008 at 11:38
- Changed state: Accepted
So did you comitted ? i downloaded last release 2.0b4 but it still does not
work with varargs :(
Original comment by [email protected] on 15 Aug 2010 at 2:18
Yes I committed but this isn't in the downloads. You will have to check out
the source and compile it.
Original comment by [email protected] on 15 Aug 2010 at 10:14
I added a unit test which tests the calling of vararg methods from beanshell:
VarargsTest.java
Original comment by [email protected] on 21 Feb 2011 at 8:58