first = true;
while (types.hasMoreElements()) {
String typeName = (String) types.nextElement();
if (!first) {
out.print(" | ");
} else {
first = false;
}
out.print(typeName);
}
out.println("\">");
while (tasks.hasMoreElements()) {
String tName = (String) tasks.nextElement();
if (!first) {
out.print(" | ");
} else {
first = false;
}
out.print(tName);
}
out.println("\">");
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/org/apache/tools/ant/taskdefs/AntStructure.java
|
Method name: void printHead(PrintWriter, Enumeration, Enumeration)
|
|
Method name: void printHead(PrintWriter, Enumeration, Enumeration)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 7
|
|
1 | first = true;↵ | | |
|
2 | while (types.hasMoreElements()) {↵ | | 1 | while (tasks.hasMoreElements()) {↵
|
3 | String typeName = (String) types.nextElement();↵ | | 2 | String tName = (String) tasks.nextElement();↵
|
4 | if (!first) {↵ | | 3 | if (!first) {↵
|
5 | out.print(" | ");↵ | | 4 | out.print(" | ");↵
|
6 | } else {↵ | | 5 | } else {↵
|
7 | first = false;↵ | | 6 | first = false;↵
|
8 | }↵ | | 7 | }↵
|
9 | out.print(typeName);↵ | | 8 | out.print(tName);↵
|
10 | }↵ | | 9 | }↵
|
11 | out.println("\">"); | | 10 | out.println("\">");
|
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 the same method |
Number of node comparisons | 20 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.7 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
13 | first = true; | | | |
14 | while (types.hasMoreElements()) | | 5 | while (tasks.hasMoreElements()) |
15 | String typeName = (String)types.nextElement(); | | 6 | String tName = (String)tasks.nextElement(); |
16 | | | 7 | |
17 | | | 8 | |
| | | | |
18 | | | 9 | |
19 | | | 10 | |
20 | out.println("\">"); | | 11 | out.println("\">"); |
Precondition Violations (0)
Row |
Violation |