~ubuntu-branches/ubuntu/feisty/proguard/feisty

« back to all changes in this revision

Viewing changes to src/proguard/shrink/UsagePrinter.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: UsagePrinter.java,v 1.16 2004/08/15 12:39:30 eric Exp $
 
1
/* $Id: UsagePrinter.java,v 1.19 2005/06/11 13:21:35 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
39
39
  implements ClassFileVisitor,
40
40
             MemberInfoVisitor
41
41
{
 
42
    private UsageMarker usageMarker;
42
43
    private boolean     printUnusedItems;
43
44
    private PrintStream ps;
44
45
 
48
49
 
49
50
    /**
50
51
     * Creates a new UsagePrinter that prints to <code>System.out</code>.
 
52
     * @param usageMarker    the usage marker that was used to mark the classes
 
53
     *                       and class members.
51
54
     * @param printUsedItems a flag that indicates whether only unused items
52
 
     * should be printed, or alternatively, only used items.
 
55
     *                       should be printed, or alternatively, only used items.
53
56
     */
54
 
    public UsagePrinter(boolean printUnusedItems)
 
57
    public UsagePrinter(UsageMarker usageMarker,
 
58
                        boolean     printUnusedItems)
55
59
    {
56
 
        this(printUnusedItems, System.out);
 
60
        this(usageMarker, printUnusedItems, System.out);
57
61
    }
58
62
 
59
63
 
60
64
    /**
61
65
     * Creates a new UsagePrinter that prints to the given stream.
 
66
     * @param usageMarker    the usage marker that was used to mark the classes
 
67
     *                       and class members.
62
68
     * @param printUsedItems a flag that indicates whether only unused items
63
 
     * should be printed, or alternatively, only used items.
 
69
     *                       should be printed, or alternatively, only used items.
64
70
     * @param printStream the stream to which to print
65
71
     */
66
 
    public UsagePrinter(boolean printUnusedItems, PrintStream printStream)
 
72
    public UsagePrinter(UsageMarker usageMarker,
 
73
                        boolean     printUnusedItems,
 
74
                        PrintStream printStream)
67
75
    {
 
76
        this.usageMarker      = usageMarker;
68
77
        this.printUnusedItems = printUnusedItems;
69
78
        this.ps               = printStream;
70
79
    }
74
83
 
75
84
    public void visitProgramClassFile(ProgramClassFile programClassFile)
76
85
    {
77
 
        if (UsageMarker.isUsed(programClassFile))
 
86
        if (usageMarker.isUsed(programClassFile))
78
87
        {
79
88
            if (printUnusedItems)
80
89
            {
109
118
 
110
119
    public void visitProgramFieldInfo(ProgramClassFile programClassFile, ProgramFieldInfo programFieldInfo)
111
120
    {
112
 
        if (UsageMarker.isUsed(programFieldInfo) ^ printUnusedItems)
 
121
        if (usageMarker.isUsed(programFieldInfo) ^ printUnusedItems)
113
122
        {
114
123
            printClassNameHeader();
115
124
 
125
134
 
126
135
    public void visitProgramMethodInfo(ProgramClassFile programClassFile, ProgramMethodInfo programMethodInfo)
127
136
    {
128
 
        if (UsageMarker.isUsed(programMethodInfo) ^ printUnusedItems)
 
137
        if (usageMarker.isUsed(programMethodInfo) ^ printUnusedItems)
129
138
        {
130
139
            printClassNameHeader();
131
140