return false;
}
Attribute other = (Attribute) obj;
if (name == null) {
if (other.name != null) {
return false;
}
} else if (!name.equals(other.name)) {
return false;
}
return false;
}
Text other = (Text) obj;
if (name == null) {
if (other.name != null) {
return false;
}
} else if (!name.equals(other.name)) {
return false;
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/MacroDef.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/MacroDef.java
|
Method name: boolean equals(Object)
|
|
Method name: boolean equals(Object)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | return false;↵ | | 1 | return false;↵
|
2 | }↵ | | 2 | }↵
|
3 | Attribute other = (Attribute) obj;↵ | | 3 | Text other = (Text) obj;↵
|
4 | if (name == null) {↵ | | 4 | if (name == null) {↵
|
5 | if (other.name != null) {↵ | | 5 | if (other.name != null) {↵
|
6 | return false;↵ | | 6 | return false;↵
|
7 | }↵ | | 7 | }↵
|
8 | } else if (!name.equals(other.name)) {↵ | | 8 | } else if (!name.equals(other.name)) {↵
|
9 | return false;↵ | | 9 | return false;↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.4 |
Clones location | Clones are in the same java file |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 5 | Text other = (Text)obj; |
5 | Attribute other = (Attribute)obj; | | | |
6 | if (name == null) | | 6 | if (name == null) |
7 | | | 7 | |
8 | | | 8 | |
9 | else if (!name.equals(other.name)) | | 9 | else if (!name.equals(other.name)) |
10 | | | 10 | |
Precondition Violations (3)
Row |
Violation |
1 | Type java.lang.String of variable other.name does not match with type java.lang.String of variable other.name |
2 | Type java.lang.String of variable other.name does not match with type java.lang.String of variable other.name |
3 | Not all possible execution flows end in a return statement |