for (int i = 0; i < files.length; i++) {
for (int j = 0; j < flist.length; j++) {
if (flist[j].getName().equals(files[i])) {
check[i] = true;
break;
}
}
}
for (int i = 0; i < files.length; i++) {
for (int j = 0; j < flist.length; j++) {
if (flist[j].getName().equals(files[i])) {
check[i] = true;
break;
}
}
}
Clone fragments detected by clone detection tool
File path: /sql12/test/src/net/sourceforge/squirrel_sql/fw/util/FileTest.java
|
|
File path: /sql12/test/src/net/sourceforge/squirrel_sql/fw/util/FileTest.java
|
Method name: void test_listFiles()
|
|
Method name: void test_listFilesLjava_io_FileFilter()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | for (int i = 0; i < files.length; i++) {↵ | | 1 | for (int i = 0; i < files.length; i++) {↵
|
2 | for (int j = 0; j < flist.length; j++) {↵ | | 2 | for (int j = 0; j < flist.length; j++) {↵
|
3 | if (flist[j].getName().equals(files[i])) {↵ | | 3 | if (flist[j].getName().equals(files[i])) {↵
|
4 | check[i] = true;↵ | | 4 | check[i] = true;↵
|
5 | break;↵ | | 5 | break;↵
|
6 | }↵ | | 6 | }↵
|
7 | }↵ | | 7 | }↵
|
8 | } | | 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) | 0.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 4.5 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
47 | for (int i = 0; i < files.length; i++) | | 37 | for (int i = 0; i < files.length; i++) |
48 | for (int j = 0; j < flist.length; j++) | | 38 | for (int j = 0; j < flist.length; j++) |
49 | if (flist[j].getName().equals(files[i])) | | 39 | if (flist[j].getName().equals(files[i])) |
50 | | | 40 | |
51 | | | 41 | |
Precondition Violations (0)
Row |
Violation |