commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vishal Goenka" <>
Subject [JEXL] - Last argument of a method invoked via JEXL cannot declare an array as expected
Date Wed, 03 Sep 2008 17:22:00 GMT
Say I declare a function:

public void fn(String s1, Object [] s2);

This function is then added to a JEXL context and referenced in an
expression thus:

fn('hello', ['a', 'b', 'c']);

This invokes the function with the argument ['a', 'b', 'c']  wrapped in
another array. 

Thus, s2[0] ==  ['a', 'b', 'c'] as opposed to s2 == ['a', 'b', 'c'] in the

I will be happy to submit a patch . for now I have worked around this by
declaring the function differently.

I now declare:

public void fn(String s1, String . s2);

and invoke it as:

fn('hello', 'a', 'b', 'c');

which does the right thing.

- Vishal

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message