You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thusitha Thilina Dayaratne (JIRA)" <ji...@apache.org> on 2015/05/09 17:55:00 UTC

[jira] [Commented] (CLI-245) A static method, by definition, is called on a class and not on an instance of that class.

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

Thusitha Thilina Dayaratne commented on CLI-245:
------------------------------------------------

I've checked the source and seems that OptionBuilder is already deprecated and already got patch which is attached with https://issues.apache.org/jira/browse/CLI-224
so is this still need to be fixed?

> A static method, by definition, is called on a class and not on an instance of that class.
> ------------------------------------------------------------------------------------------
>
>                 Key: CLI-245
>                 URL: https://issues.apache.org/jira/browse/CLI-245
>             Project: Commons CLI
>          Issue Type: Improvement
>          Components: CLI-1.x
>    Affects Versions: 1.2
>            Reporter: Ghenadie Munteanu
>            Priority: Trivial
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Please check page http://commons.apache.org/proper/commons-cli/usage.html, "OptionBuilder" session:
> Option logfile   = OptionBuilder.withArgName( "file" )
>                                 .hasArg()
>                                 .withDescription(  "use given file for log" )
>                                 .create( "logfile" );
> Here "create" method, which is a static one is called on the "OptionBuilder" instance of the object. 
> fix:
> Usually "create" method in builder classes should not be declared static.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)