commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duncan Jones (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CLI-224) OptionBuilder only has static methods, yet many return an OptionBuilder instance
Date Tue, 18 Sep 2012 21:27:07 GMT

    [ https://issues.apache.org/jira/browse/CLI-224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13458190#comment-13458190
] 

Duncan Jones edited comment on CLI-224 at 9/19/12 8:25 AM:
-----------------------------------------------------------

How about embedding a Builder class within Option and deprecating the public Option constructors
and the OptionBuilder class. Hence we can:

{code}
new Option.Builder("opt", "description").argName("Foo").build();
{code}

without impacting existing code. (This embedded builder style is suggested by Joshua Bloch
in Effective Java.)
                
      was (Author: dmjones500):
    How about embedding a Builder class within Option and deprecating the public Option constructors
and the OptionBuilder class. Hence we can:

{code}
new Option.Builder("opt", "description").argName("Foo").build();
{code}

without impacting existing code.
                  
> OptionBuilder only has static methods, yet many return an OptionBuilder instance
> --------------------------------------------------------------------------------
>
>                 Key: CLI-224
>                 URL: https://issues.apache.org/jira/browse/CLI-224
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-1.x
>    Affects Versions: 1.2
>            Reporter: Brian Blount
>         Attachments: DefaultOptionBuilder.java, DefaultOptionBuilderTest.java
>
>
> CLI-83 was closed as fixed in 2.0, but it seems that there is no current plan to release
CLI 2.0.  Could this fix be rolled into the 1.x line?  I'm attaching a new version of option
builder that addresses the issue (named DefaultOptionBuilder to maintain backwards compatability)
and a unit test for it.

--
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

Mime
View raw message