Skip to content

Commit d3c2977

Browse files
committed
Minor simplification in GnuParser to make the token list local to the flatten method
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/branches/cli-1.x@661583 13f79535-47bb-0310-9956-ffa450edef68
1 parent 10195f2 commit d3c2977

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

src/java/org/apache/commons/cli/GnuParser.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
1718
package org.apache.commons.cli;
1819

1920
import java.util.ArrayList;
21+
import java.util.List;
2022

2123
/**
2224
* The class GnuParser provides an implementation of the
@@ -28,18 +30,6 @@
2830
*/
2931
public class GnuParser extends Parser {
3032

31-
/** holder for flattened tokens */
32-
private ArrayList tokens = new ArrayList();
33-
34-
/**
35-
* <p>Resets the members to their original state i.e. remove
36-
* all of <code>tokens</code> entries.
37-
*/
38-
private void init()
39-
{
40-
tokens.clear();
41-
}
42-
4333
/**
4434
* <p>This flatten method does so using the following rules:
4535
* <ol>
@@ -62,7 +52,7 @@ private void init()
6252
protected String[] flatten(Options options, String[] arguments,
6353
boolean stopAtNonOption)
6454
{
65-
init();
55+
List tokens = new ArrayList();
6656

6757
boolean eatTheRest = false;
6858
Option currentOption = null;

0 commit comments

Comments
 (0)