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