commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vishal Goenka" <vgoe...@apache.org>
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
function.

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: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message