commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 13666] New: - HelpFormatter throws NullPointerException
Date Tue, 15 Oct 2002 19:47:16 GMT
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: commons-dev@jakarta.apache.org
        ReportedBy: oomen@piprograms.com


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:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message