commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r542151 - in /jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli: GnuParser.java Option.java PosixParser.java TypeHandler.java
Date Mon, 28 May 2007 08:32:21 GMT
Author: bayard
Date: Mon May 28 01:32:20 2007
New Revision: 542151

URL: http://svn.apache.org/viewvc?view=rev&rev=542151
Log:
Fixing Findbugs warnings and adding a bold WARNING to GnuParser that there is a large lump
of non-executable code

Modified:
    jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/GnuParser.java
    jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/Option.java
    jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/PosixParser.java
    jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/TypeHandler.java

Modified: jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/GnuParser.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/GnuParser.java?view=diff&rev=542151&r1=542150&r2=542151
==============================================================================
--- jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/GnuParser.java
(original)
+++ jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/GnuParser.java
Mon May 28 01:32:20 2007
@@ -106,6 +106,10 @@
                 }
                 else
                 {
+                    // WARNING: Findbugs reports major problems with the following code.

+                    //          As option cannot be null, currentOption cannot and 
+                    //          much of the code below is never going to be run.
+
                     currentOption = option;
 
                     // special option
@@ -169,6 +173,6 @@
             }
         }
 
-        return (String[]) tokens.toArray(new String[] {  });
+        return (String[]) tokens.toArray(new String[tokens.size()]);
     }
-}
\ No newline at end of file
+}

Modified: jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/Option.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/Option.java?view=diff&rev=542151&r1=542150&r2=542151
==============================================================================
--- jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/Option.java
(original)
+++ jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/Option.java
Mon May 28 01:32:20 2007
@@ -541,7 +541,7 @@
     public String[] getValues()
     {
         return hasNoValues()
-               ? null : (String[]) this.values.toArray(new String[] {  });
+               ? null : (String[]) this.values.toArray(new String[this.values.size()]);
     }
 
     /**

Modified: jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/PosixParser.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/PosixParser.java?view=diff&rev=542151&r1=542150&r2=542151
==============================================================================
--- jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/PosixParser.java
(original)
+++ jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/PosixParser.java
Mon May 28 01:32:20 2007
@@ -160,7 +160,7 @@
             gobble(iter);
         }
 
-        return (String[]) tokens.toArray(new String[] {  });
+        return (String[]) tokens.toArray(new String[tokens.size()]);
     }
 
     /**
@@ -308,4 +308,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}

Modified: jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/TypeHandler.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/TypeHandler.java?view=diff&rev=542151&r1=542150&r2=542151
==============================================================================
--- jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/TypeHandler.java
(original)
+++ jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/TypeHandler.java
Mon May 28 01:32:20 2007
@@ -208,14 +208,7 @@
      */
     public static Date createDate(String str)
     {
-        Date date = null;
-
-        if (date == null)
-        {
-            System.err.println("Unable to parse: " + str);
-        }
-
-        return date;
+        throw new UnsupportedOperationException("Not yet implemented");
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message