for (int i=0; i<filenames.length; i++) {
String ch = "F";
if (files[i].isDirectory()) ch = "T";
if (filenames[i].equalsIgnoreCase(f3name)) ch = "T";
if (filenames[i].equalsIgnoreCase(f4name)) ch = "T";
expected.append(ch);
}
for (int i=0; i<filenames.length; i++) {
String ch = "F";
if (files[i].isDirectory()) ch = "T";
// f2name shouldn't be selected: only timestamp has changed!
if (filenames[i].equalsIgnoreCase(f3name)) ch = "T";
if (filenames[i].equalsIgnoreCase(f4name)) ch = "T";
expected.append(ch);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java
|
Method name: void _testScenario2()
|
|
Method name: void testScenario1()
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | for (int i=0; i<filenames.length; i++) {↵ | | 1 | for (int i=0; i<filenames.length; i++) {↵
|
2 | String ch = "F";↵ | | 2 | String ch = "F";↵
|
3 | if (files[i].isDirectory()) ch = "T";↵ | | 3 | if (files[i].isDirectory()) ch = "T";↵
|
| | | 4 | // f2name shouldn't be selected: only timestamp has changed!↵
|
4 | if (filenames[i].equalsIgnoreCase(f3name)) ch = "T";↵ | | 5 | if (filenames[i].equalsIgnoreCase(f3name)) ch = "T";↵
|
5 | if (filenames[i].equalsIgnoreCase(f4name)) ch = "T";↵ | | 6 | if (filenames[i].equalsIgnoreCase(f4name)) ch = "T";↵
|
6 | expected.append(ch);↵ | | 7 | expected.append(ch);↵
|
7 | } | | 8 | }
|
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) | 1.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 37 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 9 |
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) | 1.3 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
24 | for (int i = 0; i < filenames.length; i++) | | 19 | for (int i = 0; i < filenames.length; i++) |
25 | | | 20 | |
26 | if (files[i].isDirectory()) | | 21 | if (files[i].isDirectory()) |
27 | | | 22 | |
28 | if (filenames[i].equalsIgnoreCase(f3name)) | | 23 | if (filenames[i].equalsIgnoreCase(f3name)) |
29 | | | 24 | |
30 | if (filenames[i].equalsIgnoreCase(f4name)) | | 25 | if (filenames[i].equalsIgnoreCase(f4name)) |
31 | | | 26 | |
32 | | | 27 | |
Precondition Violations (0)
Row |
Violation |