beanshell2 icon indicating copy to clipboard operation
beanshell2 copied to clipboard

add varargs

Open GoogleCodeExporter opened this issue 10 years ago • 6 comments

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

GoogleCodeExporter avatar Apr 22 '15 19:04 GoogleCodeExporter

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

GoogleCodeExporter avatar Apr 22 '15 19:04 GoogleCodeExporter

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

GoogleCodeExporter avatar Apr 22 '15 19:04 GoogleCodeExporter

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

GoogleCodeExporter avatar Apr 22 '15 19:04 GoogleCodeExporter

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

GoogleCodeExporter avatar Apr 22 '15 19:04 GoogleCodeExporter

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

GoogleCodeExporter avatar Apr 22 '15 19:04 GoogleCodeExporter

See the issue 83 too. 

Original comment by [email protected] on 12 Nov 2012 at 9:47

GoogleCodeExporter avatar Apr 22 '15 19:04 GoogleCodeExporter