[ 
https://issues.apache.org/jira/browse/JEXL-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12863274#action_12863274
 ] 

Tobias Schulte commented on JEXL-101:
-------------------------------------

I wanted to give another example, that shows the real problem, but it seems 
that java.util.Formatter, where i thought would be a problem, itself is not 
consistent.

{code:java}formatter.format("%1$s", null);{code}
outputs "null"

{code:java}formatter.format("%1$s %2$s %3$s", null);{code}
outputs "null null null" (but should throw a MissingFormatArgumentException, at 
least if I understand the documentation correctly)

but

{code:java}formatter.format("%1$s %2$s %3$s", null, null);{code}
throws a MissingFormatArgumentException. 

Since we are using formatters I thought your optimization in MethodExecutor 
would cause MissingFormatArgumentExceptions, which it does not seem to do.

But nontheless I would expect callMixed(1, null) to be equal to callMixed(1, 
new Integer[]{null}).

> Vararg methods where the first argument is no vararg can not be called with 
> only the fixed parameters given
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: JEXL-101
>                 URL: https://issues.apache.org/jira/browse/JEXL-101
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 2.0.1
>            Reporter: Tobias Schulte
>            Assignee: Henri Biestro
>             Fix For: 2.0.2
>
>         Attachments: jexl-varargs.patch
>
>
> When you have a public String testVarArgsMixed(Integer fixed, Integer[] args) 
> in a class Test, put a test instance in the context and evaluate the 
> expression test.testVarArgsMixed(1), the MethodExecutor is not able to find 
> the method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to