File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPool.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/depend/constantpool/ConstantPool.java | |||
Method name: int getInterfaceMethodRefEntry(String, String, String)
|
Method name: int getNameAndTypeEntry(String, String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 5 | |||
1 | Object element = entries.elementAt(i);↵ | |||
1 | if (element instanceof InterfaceMethodRefCPInfo) {↵ | 2 | if (element instanceof NameAndTypeCPInfo) {↵ | |
2 | InterfaceMethodRefCPInfo interfaceMethodRefEntry↵ | 3 | NameAndTypeCPInfo nameAndTypeEntry↵ | |
3 | = (InterfaceMethodRefCPInfo) element;↵ | 4 | = (NameAndTypeCPInfo) element;↵ | |
4 | if (interfaceMethodRefEntry.getInterfaceMethodClassName().equals(↵ | 5 | if (↵ | |
5 | interfaceMethodClassName)↵ | |||
6 | && interfaceMethodRefEntry.getInterfaceMethodName().equals(↵ | |||
7 | interfaceMethodName)↵ | |||
8 | && interfaceMethodRefEntry.getInterfaceMethodType().equals(↵ | |||
9 | interfaceMethodT↵ | 6 | nameAndTypeEntry.getName().equals(name)↵ | |
10 | ype)) {↵ | 7 | && nameAndTypeEntry.getType().equals(type)) {↵ | |
11 | index = i;↵ | 8 | index = i;↵ | |
12 | }↵ | 9 | }↵ | |
13 | } | 10 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 3 | Object element = entries.elementAt(i); | |||||||||||||||||||||||||||||||||||||||||
4 | if (element instanceof InterfaceMethodRefCPInfo) |
| 4 | if (element instanceof NameAndTypeCPInfo) | ||||||||||||||||||||||||||||||||||||||||
5 | InterfaceMethodRefCPInfo interfaceMethodRefEntry = (InterfaceMethodRefCPInfo)element; |
| 5 | NameAndTypeCPInfo nameAndTypeEntry = (NameAndTypeCPInfo)element; | ||||||||||||||||||||||||||||||||||||||||
6 | if (interfaceMethodRefEntry.getInterfaceMethodClassName().equals(interfaceMethodClassName) && interfaceMethodRefEntry.getInterfaceMethodName().equals(interfaceMethodName) && interfaceMethodRefEntry.getInterfaceMethodType().equals(interfaceMethodType)) |
| 6 | if (nameAndTypeEntry.getName().equals(name) && nameAndTypeEntry.getType().equals(type)) | ||||||||||||||||||||||||||||||||||||||||
7 | index = i; | 7 | index = i; |
Row | Violation |
---|---|
1 | Unmatched statement Object element=entries.elementAt(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression interfaceMethodRefEntry.getInterfaceMethodClassName() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression nameAndTypeEntry.getName() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression interfaceMethodRefEntry.getInterfaceMethodName() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression nameAndTypeEntry.getType() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression interfaceMethodRefEntry.getInterfaceMethodClassName().equals(interfaceMethodClassName) && interfaceMethodRefEntry.getInterfaceMethodName().equals(interfaceMethodName) && interfaceMethodRefEntry.getInterfaceMethodType().equals(interfaceMethodType) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression nameAndTypeEntry.getName().equals(name) && nameAndTypeEntry.getType().equals(type) cannot be parameterized, because it has dependencies to/from statements that will be extracted |