public class FieldRefCPInfo extends ConstantPoolEntry { /** Name of the field's class */ private String fieldClassName; /** name of the field in that class */ private String fieldName; /** The type of the field */ private String fieldType; /** Index into the constant pool for the class */ private int classIndex; /** Index into the constant pool for the name and type entry */ private int nameAndTypeIndex; /** Constructor. */ public FieldRefCPInfo() { super(CONSTANT_FIELDREF, 1); } /** * read a constant pool entry from a class stream. * * @param cpStream the DataInputStream which contains the constant pool * entry to be read. * @exception IOException if there is a problem reading the entry from * the stream. */ public void read(DataInputStream cpStream) throws IOException { classIndex = cpStream.readUnsignedShort(); nameAndTypeIndex = cpStream.readUnsignedShort(); } /** * Resolve this constant pool entry with respect to its dependents in * the constant pool. * * @param constantPool the constant pool of which this entry is a member * and against which this entry is to be resolved. */ public void resolve(ConstantPool constantPool) { ClassCPInfo fieldClass = (ClassCPInfo) constantPool.getEntry(classIndex); fieldClass.resolve(constantPool); fieldClassName = fieldClass.getClassName(); NameAndTypeCPInfo nt = (NameAndTypeCPInfo) constantPool.getEntry(nameAndTypeIndex); nt.resolve(constantPool); fieldName = nt.getName(); fieldType = nt.getType(); super.resolve(constantPool); } /** * Print a readable version of the constant pool entry. * * @return the string representation of this constant pool entry. */ public String toString() { String value; if (isResolved()) { value = "Field : Class = " + fieldClassName + ", name = " + fieldName + ", type = " + fieldType; } else { value = "Field : Class index = " + classIndex + ", name and type index = " + nameAndTypeIndex; } return value; } /** * Gets the name of the class defining the field * * @return the name of the class defining the field */ public String getFieldClassName() { return fieldClassName; } /** * Get the name of the field * * @return the field's name */ public String getFieldName() { return fieldName; } /** * Get the type of the field * * @return the field's type in string format */ public String getFieldType() { return fieldType;
public class InterfaceMethodRefCPInfo extends ConstantPoolEntry { /** the class name of the class defining the interface method */ private String interfaceMethodClassName; /** the name of the interface nmethod */ private String interfaceMethodName; /** the method signature of the interface method */ private String interfaceMethodType; /** * the index into the constant pool of the class entry for the interface * class */ private int classIndex; /** * the index into the constant pool of the name and type entry * describing the method */ private int nameAndTypeIndex; /** Constructor. */ public InterfaceMethodRefCPInfo() { super(CONSTANT_INTERFACEMETHODREF, 1); } /** * read a constant pool entry from a class stream. * * @param cpStream the DataInputStream which contains the constant pool * entry to be read. * @exception IOException if there is a problem reading the entry from * the stream. */ public void read(DataInputStream cpStream) throws IOException { classIndex = cpStream.readUnsignedShort(); nameAndTypeIndex = cpStream.readUnsignedShort(); } /** * Resolve this constant pool entry with respect to its dependents in * the constant pool. * * @param constantPool the constant pool of which this entry is a member * and against which this entry is to be resolved. */ public void resolve(ConstantPool constantPool) { ClassCPInfo interfaceMethodClass = (ClassCPInfo) constantPool.getEntry(classIndex); interfaceMethodClass.resolve(constantPool); interfaceMethodClassName = interfaceMethodClass.getClassName(); NameAndTypeCPInfo nt = (NameAndTypeCPInfo) constantPool.getEntry(nameAndTypeIndex); nt.resolve(constantPool); interfaceMethodName = nt.getName(); interfaceMethodType = nt.getType(); super.resolve(constantPool); } /** * Print a readable version of the constant pool entry. * * @return the string representation of this constant pool entry. */ public String toString() { String value; if (isResolved()) { value = "InterfaceMethod : Class = " + interfaceMethodClassName + ", name = " + interfaceMethodName + ", type = " + interfaceMethodType; } else { value = "InterfaceMethod : Class index = " + classIndex + ", name and type index = " + nameAndTypeIndex; } return value; } /** * Gets the name of the class defining the interface method * * @return the name of the class defining the interface method */ public String getInterfaceMethodClassName() { return interfaceMethodClassName; } /** * Get the name of the interface method * * @return the name of the interface method */ public String getInterfaceMethodName() { return interfaceMethodName; } /** * Gets the type of the interface method * * @return the interface method's type signature */ public String getInterfaceMethodType() { return interfaceMethodType;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/depend/constantpool/FieldRefCPInfo.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/depend/constantpool/InterfaceMethodRefCPInfo.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class FieldRefCPInfo extends ConstantPoolEntry {
1
public class InterfaceMethodRefCPInfo extends ConstantPoolEntry {
2
    /** Name of the field's class */
2
    /** the class name of the class defining the interface method */
3
    private String fieldClassName;
3
    private String interfaceMethodClassName;
4
    /** name of the field in that class */
4
    /** the name of the interface nmethod */
5
    private String fieldName;
5
    private String interfaceMethodName;
6
    /** The type of the field */
6
    /** the method signature of the interface method */
7
    private String fieldType;
7
    private String interfaceMethodType;
8
    /** I
8
    /**
9
ndex into the constant pool for the class
9
     * the index into the constant pool of the class entry for the interface
10
     * class
10
 */
11
     */
11
    private int classIndex;
12
    private int classIndex;
12
    /** I
13
    /**
13
ndex into the constant pool for the name and type entry
14
     * the index into the constant pool of the name and type entry
15
     * describing the method
14
 */
16
     */
15
    private int nameAndTypeIndex;
17
    private int nameAndTypeIndex;
16
    /** Constructor.  */
18
    /** Constructor. */
17
    public FieldRefCPInfo() {
19
    public InterfaceMethodRefCPInfo() {
18
        super(CONSTANT_FIELDREF, 1);
20
        super(CONSTANT_INTERFACEMETHODREF, 1);
19
    }
21
    }
20
    /**
22
    /**
21
     * read a constant pool entry from a class stream.
23
     * read a constant pool entry from a class stream.
22
     *
24
     *
23
     * @param cpStream the DataInputStream which contains the constant pool
25
     * @param cpStream the DataInputStream which contains the constant pool
24
     *      entry to be read.
26
     *      entry to be read.
25
     * @exception IOException if there is a problem reading the entry from
27
     * @exception IOException if there is a problem reading the entry from
26
     *      the stream.
28
     *      the stream.
27
     */
29
     */
28
    public void read(DataInputStream cpStream) throws IOException {
30
    public void read(DataInputStream cpStream) throws IOException {
29
        classIndex = cpStream.readUnsignedShort();
31
        classIndex = cpStream.readUnsignedShort();
30
        nameAndTypeIndex = cpStream.readUnsignedShort();
32
        nameAndTypeIndex = cpStream.readUnsignedShort();
31
    }
33
    }
32
    /**
34
    /**
33
     * Resolve this constant pool entry with respect to its dependents in
35
     * Resolve this constant pool entry with respect to its dependents in
34
     * the constant pool.
36
     * the constant pool.
35
     *
37
     *
36
     * @param constantPool the constant pool of which this entry is a member
38
     * @param constantPool the constant pool of which this entry is a member
37
     *      and against which this entry is to be resolved.
39
     *      and against which this entry is to be resolved.
38
     */
40
     */
39
    public void resolve(ConstantPool constantPool) {
41
    public void resolve(ConstantPool constantPool) {
40
        ClassCPInfo fieldClass
42
        ClassCPInfo interfaceMethodClass
41
            = (ClassCPInfo) constantPool.getEntry(classIndex);
43
             = (ClassCPInfo) constantPool.getEntry(classIndex);
42
        fieldClass.resolve(constantPool);
44
        interfaceMethodClass.resolve(constantPool);
43
        fieldClassName = fieldClass.getClassName();
45
        interfaceMethodClassName = interfaceMethodClass.getClassName();
44
        NameAndTypeCPInfo nt
46
        NameAndTypeCPInfo nt
45
            = (NameAndTypeCPInfo) constantPool.getEntry(nameAndTypeIndex);
47
             = (NameAndTypeCPInfo) constantPool.getEntry(nameAndTypeIndex);
46
        nt.resolve(constantPool);
48
        nt.resolve(constantPool);
47
        fieldName = nt.getName();
49
        interfaceMethodName = nt.getName();
48
        fieldType = nt.getType();
50
        interfaceMethodType = nt.getType();
49
        super.resolve(constantPool);
51
        super.resolve(constantPool);
50
    }
52
    }
51
    /**
53
    /**
52
     * Print a readable version of the constant pool entry.
54
     * Print a readable version of the constant pool entry.
53
     *
55
     *
54
     * @return the string representation of this constant pool entry.
56
     * @return the string representation of this constant pool entry.
55
     */
57
     */
56
    public String toString() {
58
    public String toString() {
57
        String value;
59
        String value;
58
        if (isResolved()) {
60
        if (isResolved()) {
59
            value = "Field : Class = " + fieldClassName + ", name = "
61
            value = "InterfaceMethod : Class = " + 
60
                + fieldName + ", type = " + fiel
62
interfaceMethodClassName
63
                 + ", name = " + interfaceMethodName + ", type = "
61
dType;
64
                 + interfaceMethodType;
62
        } else {
65
        } else {
63
            value = "Field : Class index = " + classIndex
66
            value = "InterfaceMethod : Class index = " + classIndex
64
                + ", name and type index = " + nameAndTypeIndex;
67
                 + ", name and type index = " + nameAndTypeIndex;
65
        }
68
        }
66
        return value;
69
        return value;
67
    }
70
    }
68
    /**
71
    /**
69
     * Gets the name of the class defining the field
72
     * Gets the name of the class defining the interface method
70
     *
73
     *
71
     * @return the name of the class defining the field
74
     * @return the name of the class defining the interface method
72
     */
75
     */
73
    public String getFieldClassName() {
76
    public String getInterfaceMethodClassName() {
74
        return fieldClassName;
77
        return interfaceMethodClassName;
75
    }
78
    }
76
    /**
79
    /**
77
     * Get the name of the field
80
     * Get the name of the interface method
78
     *
81
     *
79
     * @return the field's name
82
     * @return the name of the interface method
80
     */
83
     */
81
    public String getFieldName() {
84
    public String getInterfaceMethodName() {
82
        return fieldName;
85
        return interfaceMethodName;
83
    }
86
    }
84
    /**
87
    /**
85
     * Get the type of the field
88
     * Gets the type of the interface method
86
     *
89
     *
87
     * @return the field's type in string format
90
     * @return the interface method's type signature
88
     */
91
     */
89
    public String getFieldType() {
92
    public String getInterfaceMethodType() {
90
        return fieldType;
93
        return interfaceMethodType;
91
    
94
    
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0