You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Peter Kriens (JIRA)" <ji...@apache.org> on 2011/03/30 08:43:05 UTC

[jira] [Updated] (FELIX-2894) Gogo does not handles options but not parameters

     [ https://issues.apache.org/jira/browse/FELIX-2894?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Kriens updated FELIX-2894:
--------------------------------


Committed a fix but I think this needs better looking. The xargs list gets modified because with parameters, entries are removed. As it should be. However, I do not completely understand why xargs is checked. I've removed the check and all test cases run but it would be nice if someone looked deeper. Maybe when I work on 147 again I can take a deeper look.

> Gogo does not handles options but not parameters
> ------------------------------------------------
>
>                 Key: FELIX-2894
>                 URL: https://issues.apache.org/jira/browse/FELIX-2894
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo Runtime
>            Reporter: Peter Kriens
>
> If you create a function with a parameter then the correct method cannot be found:
> public void xyz( @Parameter( names="-v", absentValue="absent") String string ) { return string; }
> This method is not found for xyz -v abc
> There were two bugs in the code:
> - annotation values can never be null but null was checked for the presentValue to see if it was not there.
> - After handling the parameters the new length of the command line was checked against the xargs. However, this still contained the parameter name + value. So the size was too high to match.
> I've added a check for the Parameter.UNSPECIFIED when checking the status of presentValue and I removed the check for the length of xargs, only types is relevant I think. However, might need some other pair of eyes

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira