for (int i = 0; i < (files.length - 1); i++) {
FileWrapper f = new FileWrapperImpl(dir, files[i]);
FileOutputStream fos = new FileOutputStream(f.getAbsolutePath());
fos.close();
}
for (int i = 0; i < files.length; i++) {
FileWrapper f = new FileWrapperImpl(dir, files[i]);
FileOutputStream fos = new FileOutputStream(f.getAbsolutePath());
fos.close();
}
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_list()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (int i = 0; i < (files.length - 1); i++) {↵ | | 1 | for (int i = 0; i < files.length; i++) {↵
|
2 | FileWrapper f = new FileWrapperImpl(dir, files[i]);↵ | | 2 | FileWrapper f = new FileWrapperImpl(dir, files[i]);↵
|
3 | FileOutputStream fos = new FileOutputStream(f.getAbsolutePath());↵ | | 3 | FileOutputStream fos = new FileOutputStream(f.getAbsolutePath());↵
|
4 | fos.close();↵ | | 4 | fos.close();↵
|
5 | } | | 5 | }
|
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 | 18 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 3.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
20 | for (int i = 0; i < (files.length - 1); i++) | | 22 | for (int i = 0; i < files.length; i++) |
21 | FileWrapper f = new FileWrapperImpl(dir, files[i]); | | 23 | FileWrapper f = new FileWrapperImpl(dir, files[i]); |
22 | FileOutputStream fos = new FileOutputStream(f.getAbsolutePath()); | | 24 | FileOutputStream fos = new FileOutputStream(f.getAbsolutePath()); |
23 | | | 25 | |
Precondition Violations (0)
Row |
Violation |