~ubuntu-branches/ubuntu/maverick/proguard/maverick

« back to all changes in this revision

Viewing changes to src/proguard/ArgumentWordReader.java

  • Committer: Bazaar Package Importer
  • Author(s): Sam Clegg
  • Date: 2005-11-13 09:42:59 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051113094259-432zf4yyw4890mmn
Tags: 3.4-1
* New upstream release (Closes: #338355)
* debian/control: bump standards version
* debian/copyright: update FSF address
* increase java stack size for proguard and proguardgui

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: ArgumentWordReader.java,v 1.11 2004/08/15 12:39:30 eric Exp $
 
1
/* $Id: ArgumentWordReader.java,v 1.14 2005/06/11 13:13:15 eric Exp $
2
2
 *
3
3
 * ProGuard -- shrinking, optimization, and obfuscation of Java class files.
4
4
 *
5
 
 * Copyright (c) 2002-2004 Eric Lafortune (eric@graphics.cornell.edu)
 
5
 * Copyright (c) 2002-2005 Eric Lafortune (eric@graphics.cornell.edu)
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify it
8
8
 * under the terms of the GNU General Public License as published by the Free
35
35
    private int      index = 0;
36
36
 
37
37
 
 
38
//    /**
 
39
//     * Creates a new ArgumentWordReader for the given arguments.
 
40
//     */
 
41
//    public ArgumentWordReader(String[] arguments)
 
42
//    {
 
43
//        this(arguments, null);
 
44
//    }
 
45
//
 
46
//
38
47
    /**
39
 
     * Creates a new ArgumentWordReader for the given arguments.
 
48
     * Creates a new ArgumentWordReader for the given arguments, with the
 
49
     * given base directory.
40
50
     */
41
 
    public ArgumentWordReader(String[] arguments)
 
51
    public ArgumentWordReader(String[] arguments, File baseDir)
42
52
    {
 
53
        super(baseDir);
 
54
 
43
55
        this.arguments = arguments;
44
56
    }
45
57
 
65
77
     * the argument list.
66
78
     */
67
79
    public static void main(String[] args) {
 
80
 
68
81
        try
69
82
        {
70
 
            WordReader reader = new ArgumentWordReader(args);
71
 
            while (true)
72
 
            {
73
 
                String word = reader.nextWord();
74
 
                if (word == null)
75
 
                    System.exit(-1);
76
 
 
77
 
                System.err.println("["+word+"]");
78
 
            }
79
 
        } catch (Exception ex) {
 
83
            WordReader reader = new ArgumentWordReader(args, null);
 
84
 
 
85
            try
 
86
            {
 
87
                while (true)
 
88
                {
 
89
                    String word = reader.nextWord();
 
90
                    if (word == null)
 
91
                        System.exit(-1);
 
92
 
 
93
                    System.err.println("["+word+"]");
 
94
                }
 
95
            }
 
96
            catch (Exception ex)
 
97
            {
 
98
                ex.printStackTrace();
 
99
            }
 
100
            finally
 
101
            {
 
102
                reader.close();
 
103
            }
 
104
        }
 
105
        catch (IOException ex)
 
106
        {
80
107
            ex.printStackTrace();
81
108
        }
82
109
    }