You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2010/03/02 08:09:27 UTC

[jira] Closed: (CLI-191) Coding error: OptionGroup.setSelected causes java.lang.NullPointerException

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

Henri Yandell closed CLI-191.
-----------------------------

    Resolution: Fixed

Per report this is already fixed - resolving.

> Coding error: OptionGroup.setSelected causes java.lang.NullPointerException
> ---------------------------------------------------------------------------
>
>                 Key: CLI-191
>                 URL: https://issues.apache.org/jira/browse/CLI-191
>             Project: Commons CLI
>          Issue Type: Bug
>    Affects Versions: 1.2
>            Reporter: gg
>             Fix For: 1.3
>
>
> Code snippet from OptionGroup.setSelected(Option option):
> ...
>         if (selected == null || selected.equals(option.getOpt()))
>         {
>             selected = option.getOpt(); 
>         }
>         else
>         {
>             throw new AlreadySelectedException(this, option);
>         }
> ...
> When parameter option is "null" to reset the selected option, selected.equals(option.getOpt()) will obviously fail.
> Issue is already fixed in the head revision of 1.3.

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