You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2009/07/30 11:11:14 UTC

[jira] Commented: (FELIX-1408) [gogo] coercion of args to match varargs method is inconsistent

    [ https://issues.apache.org/jira/browse/FELIX-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737047#action_12737047 ] 

Guillaume Nodet commented on FELIX-1408:
----------------------------------------

I don't think $list should be expanded at all.
Doing so means you can't have access to the list in the method.

I would rather go for:

> echo $list
[a, b, c]

> echo x $list
x [a, b, c]

> echo $list x
[a, b, c] x



> [gogo] coercion of args to match varargs method is inconsistent
> ---------------------------------------------------------------
>
>                 Key: FELIX-1408
>                 URL: https://issues.apache.org/jira/browse/FELIX-1408
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo
>            Reporter: Derek Baum
>            Assignee: Derek Baum
>            Priority: Minor
>
> gogo coerces the supplied arguments to match those required by the method.
> when the last parameter of a method is an array, gogo will coerce all remaining args into the array.
> For example:
> echo is defined as String echo(Object[] args);
> > echo d e f
> d e f
> above, gogo has coerced the 3 arguments into a single args[] array argument
> > list = [a b c]
> a
> b
> c
> > echo $list
> a b c
> here gogo passes the list directly, rather than as the first element of an array
> However, this is inconsistent when extra args are given:
> echo $list x
> x a b c
> The bug here is that the argument 'x' appears as the first, rather than the last argument to echo
>  echo x $list
> x [a, b, c]
> The bug here is that the list is no longer expanded.
> The result should be:
> x a b c

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