commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r661583 - /commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/GnuParser.java
Date Fri, 30 May 2008 07:44:33 GMT
Author: ebourg
Date: Fri May 30 00:44:33 2008
New Revision: 661583

URL: http://svn.apache.org/viewvc?rev=661583&view=rev
Log:
Minor simplification in GnuParser to make the token list local to the flatten method

Modified:
    commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/GnuParser.java

Modified: commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/GnuParser.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/GnuParser.java?rev=661583&r1=661582&r2=661583&view=diff
==============================================================================
--- commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/GnuParser.java (original)
+++ commons/proper/cli/branches/cli-1.x/src/java/org/apache/commons/cli/GnuParser.java Fri
May 30 00:44:33 2008
@@ -14,9 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.cli;
 
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * The class GnuParser provides an implementation of the 
@@ -28,18 +30,6 @@
  */
 public class GnuParser extends Parser {
 
-    /** holder for flattened tokens */
-    private ArrayList tokens = new ArrayList();
-
-    /**
-     * <p>Resets the members to their original state i.e. remove
-     * all of <code>tokens</code> entries.
-     */
-    private void init()
-    {
-        tokens.clear();
-    }
-
     /**
      * <p>This flatten method does so using the following rules:
      * <ol>
@@ -62,7 +52,7 @@
     protected String[] flatten(Options options, String[] arguments, 
                                boolean stopAtNonOption)
     {
-        init();
+        List tokens = new ArrayList();
 
         boolean eatTheRest = false;
         Option currentOption = null;



Mime
View raw message