while (dir.getCanonicalPath().length() < 256) {
sb2.append(0);
dir = new FileWrapperImpl(sb2.toString());
assertTrue("mkdir " + dir.getCanonicalPath().length() + " failed",
dir.mkdir());
assertTrue("mkdir " + dir.getCanonicalPath().length()
+ " worked but exists check failed", dir.exists());
dir.deleteOnExit();
}
while (dir.getCanonicalPath().length() < 256) {
sb.append(0);
dir = new FileWrapperImpl(sb.toString());
assertTrue("mkdir " + dir.getCanonicalPath().length() + " failed",
dir.mkdir());
assertTrue("mkdir " + dir.getCanonicalPath().length()
+ " worked but exists check failed", dir.exists());
dir.deleteOnExit();
}
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_mkdir()
|
|
Method name: void test_mkdir()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | while (dir.getCanonicalPath().length() < 256) {↵ | | 1 | while (dir.getCanonicalPath().length() < 256) {↵
|
2 | sb2.append(0);↵ | | 2 | sb.append(0);↵
|
3 | dir = new FileWrapperImpl(sb2.toString());↵ | | 3 | dir = new FileWrapperImpl(sb.toString());↵
|
4 | assertTrue("mkdir " + dir.getCanonicalPath().length() + " failed",↵ | | 4 | assertTrue("mkdir " + dir.getCanonicalPath().length() + " failed",↵
|
5 | dir.mkdir());↵ | | 5 | dir.mkdir());↵
|
6 | assertTrue("mkdir " + dir.getCanonicalPath().length()↵ | | 6 | assertTrue("mkdir " + dir.getCanonicalPath().length()↵
|
7 | + " worked but exists check failed", dir.exists());↵ | | 7 | + " worked but exists check failed", dir.exists());↵
|
8 | dir.deleteOnExit();↵ | | 8 | dir.deleteOnExit();↵
|
9 | } | | 9 | }
|
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 | 38 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 7.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
30 | while (dir.getCanonicalPath().length() < 256) | | 23 | while (dir.getCanonicalPath().length() < 256) |
31 | | | 24 | |
32 | dir = new FileWrapperImpl(sb2.toString()); | | 25 | dir = new FileWrapperImpl(sb.toString()); |
33 | assertTrue("mkdir " + dir.getCanonicalPath().length() + " failed", dir.mkdir()); | | 26 | assertTrue("mkdir " + dir.getCanonicalPath().length() + " failed", dir.mkdir()); |
34 | assertTrue("mkdir " + dir.getCanonicalPath().length() + " worked but exists check failed", dir.exists()); | | 27 | assertTrue("mkdir " + dir.getCanonicalPath().length() + " worked but exists check failed", dir.exists()); |
35 | | | 28 | |
Precondition Violations (0)
Row |
Violation |