You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2002/10/19 11:19:52 UTC

DO NOT REPLY [Bug 13780] New: - Option.hasArgName() has a bug

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=13780>.
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=13780

Option.hasArgName() has a bug

           Summary: Option.hasArgName() has a bug
           Product: Commons
           Version: 1.0 Beta 2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: CLI
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: shivaken@jcom.home.ne.jp


I noticed a bug.   
NullPointerException is occured, with helpFormatter.printHelp()  
  
This is a patch. 
  
--- Option.java.orig    2002-10-18 18:27:53.000000000 +0900  
+++ Option.java 2002-10-19 16:48:35.000000000 +0900  
@@ -395,7 +395,7 @@  
       * set.  
       */  
      public boolean hasArgName() {  
-         return (this.argName != null || this.argName.length() > 0 );  
+         return (this.argName != null && this.argName.length() > 0 );  
      }  
   
      /**   
 
Or just 
           return (this.argName != null); 
??

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>