You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sergey B. (JIRA)" <ji...@apache.org> on 2013/03/16 17:26:12 UTC
[jira] [Closed] (CLI-235) OptionBuilder wrong design
[ https://issues.apache.org/jira/browse/CLI-235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey B. closed CLI-235.
-------------------------
Resolution: Duplicate
> OptionBuilder wrong design
> --------------------------
>
> Key: CLI-235
> URL: https://issues.apache.org/jira/browse/CLI-235
> Project: Commons CLI
> Issue Type: Bug
> Components: Options definition
> Affects Versions: 1.2
> Reporter: Sergey B.
> Priority: Minor
> Labels: OptionBuilder
>
> OptionBuilder uses static variables to do its work. That's why it is not thread safe.
> More than that, static builder methods doesn't conform to Java good style of accessing static members. Such members belong to the class and must be accessed in static way.
> Consider creating new builder-like class like that:
> {code:java}
> OptionBuilder optionBuilder = OptionBuilder.newInstance();
> options.add(optionBuilder.withDescription().hasArg().create());
> options.add(optionBuilder.withDescription().hasArg().create());
> options.add(optionBuilder.withDescription().hasArg().create());
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira