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 13780] New: - Option.hasArgName() has a bug
Date Sat, 19 Oct 2002 09:19:52 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=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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message