DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13666>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13666

HelpFormatter throws NullPointerException

           Summary: HelpFormatter throws NullPointerException
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: CLI
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


java.lang.NullPointerException
        at org.apache.commons.cli.Option.hasArgName(Option.java:398)
        at org.apache.commons.cli.HelpFormatter.renderOptions(HelpFormatter.java:368)
        at org.apache.commons.cli.HelpFormatter.printOptions(HelpFormatter.java:312)
        at org.apache.commons.cli.HelpFormatter.printHelp(HelpFormatter.java:209)
        at org.apache.commons.cli.HelpFormatter.printHelp(HelpFormatter.java:165)
        at org.apache.commons.cli.HelpFormatter.printHelp(HelpFormatter.java:145)
        at org.apache.commons.cli.HelpFormatter.printHelp(HelpFormatter.java:136)

This can be fixed by applying the following:

Index: Option.java
===================================================================
RCS file:
/home/cvspublic/jakarta-commons/cli/src/java/org/apache/commons/cli/Option.java,v
retrieving revision 1.14
diff -u -r1.14 Option.java
--- Option.java 8 Oct 2002 21:24:11 -0000       1.14
+++ Option.java 15 Oct 2002 19:45:29 -0000
@@ -395,7 +395,7 @@
       * set.
       */
      public boolean hasArgName() {
-         return (this.argName != null || this.argName.length() > 0 );
+         return (this.argName != null && this.argName.length() > 0 );
      }
 
      /**

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to