~ubuntu-branches/ubuntu/wily/proguard/wily

« back to all changes in this revision

Viewing changes to src/proguard/classfile/ProgramMember.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2014-04-10 13:58:11 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20140410135811-ddwzt2avu94rnolt
Tags: 4.11-1
* Team upload.
* New upstream release
* Removed the non-free documentation from the package (Closes: #719706)
* Removed the pre-built jars from the upstream tarball
* debian/control:
  - The package is now co-maintained with the Java Team
  - Standards-Version updated to 3.9.5 (no changes)
  - Added the Vcs-* fields
  - Added the Homepage field
* Switch to debhelper level 9
* Use XZ compression for the upstream tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * ProGuard -- shrinking, optimization, obfuscation, and preverification
3
3
 *             of Java bytecode.
4
4
 *
5
 
 * Copyright (c) 2002-2012 Eric Lafortune (eric@graphics.cornell.edu)
 
5
 * Copyright (c) 2002-2013 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
21
21
package proguard.classfile;
22
22
 
23
23
 
24
 
import proguard.classfile.attribute.*;
 
24
import proguard.classfile.attribute.Attribute;
25
25
import proguard.classfile.attribute.visitor.AttributeVisitor;
26
26
import proguard.classfile.visitor.MemberVisitor;
27
27
 
53
53
 
54
54
 
55
55
    /**
56
 
     * Creates an initialized ProgramMember. 
 
56
     * Creates an initialized ProgramMember.
57
57
     */
58
58
    protected ProgramMember(int         u2accessFlags,
59
59
                            int         u2nameIndex,
70
70
 
71
71
 
72
72
    /**
73
 
     * Returns the line number range of the given class member as "m:n",
74
 
     * if it can find it, or <code>null</code> otherwise.
75
 
     */
76
 
    public String getLineNumberRange(Clazz clazz)
77
 
    {
78
 
        CodeAttribute codeAttribute =
79
 
            (CodeAttribute)getAttribute(clazz, ClassConstants.ATTR_Code);
80
 
        if (codeAttribute  == null)
81
 
        {
82
 
            return null;
83
 
        }
84
 
 
85
 
        LineNumberTableAttribute lineNumberTableAttribute =
86
 
            (LineNumberTableAttribute)codeAttribute.getAttribute(clazz,
87
 
                                                                 ClassConstants.ATTR_LineNumberTable);
88
 
        if (lineNumberTableAttribute  == null)
89
 
        {
90
 
            return null;
91
 
        }
92
 
 
93
 
        return "" +
94
 
               lineNumberTableAttribute.getLineNumber(0) +
95
 
               ":" +
96
 
               lineNumberTableAttribute.getLineNumber(Integer.MAX_VALUE);
97
 
    }
98
 
 
99
 
 
100
 
    /**
101
73
     * Returns the (first) attribute with the given name.
102
74
     */
103
75
    private Attribute getAttribute(Clazz clazz, String name)