Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Cannot Reproduce
-
2.1.1
-
None
Description
Say I have an object in my context with a method like:
public <T> List<T> asList(T[] array) { return Arrays.asList(array); }
When I call that from a JEXL expression with something like:
utils.asList(["foo", "bar"])
The JEXL method finder seems to treat the method like a varargs method, and puts the whole string array into the first element of the formal parameter, rather than mapping the string array onto the object array. That is, the method receives an array of length 1, with that first element being a string array of length 2.
To illustrate further, the problem goes away if I change the method to look like:
public <T> List<T> asList(T[] array, String ... dummy) { return Arrays.asList(array); }
since this forces the T[] array to be interpreted correctly.