for (int i = 0; i < values.length; i++) {
if (i != 0) {
sb.append(" | ");
}
sb.append(type.getMethod("name", (Class[]) null)
.invoke(values[i], (Object[]) null));
}
for (int i = 0; i < result.length; ++i) {
if (i != 0) {
b.append("|");
}
b.append(result[i]);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/AntStructure.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/mappers/MapperResult.java
|
Method name: void printElementDecl(PrintWriter, Project, String, Class)
|
|
Method name: void execute()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (int i = 0; i < values.length; i++) {↵ | | 1 | for (int i = 0; i < result.length; ++i) {↵
|
2 | if (i != 0) {↵ | | 2 | if (i != 0) {↵
|
3 | sb.append(" | ");↵ | | 3 | b.append("|");↵
|
4 | }↵ | | 4 | }↵
|
5 | sb.append(type.getMethod("name", (Class[]) null)↵ | | 5 | ↵
|
6 | .invoke(values[i], (Object[]) null));↵ | | |
|
7 | ↵ | | 6 | b.append(result[i]);↵
|
8 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
71 | if (i != 0) | | 13 | if (i != 0) |
72 | | | 14 | |
Precondition Violations (0)
Row |
Violation |