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_toURL2()
|
Method name: void test_toURI2()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | FileWrapper f = new FileWrapperImpl(System.getProperty("user.dir"), "a/b/c/../d/e/./f");↵ | 1 | FileWrapper f = new FileWrapperImpl(System.getProperty("user.dir"), "a/b/c/../d/e/./f");↵ | |
2 | String path = f.getAbsolutePath();↵ | 2 | String path = f.getAbsolutePath();↵ | |
3 | path = path.replace(File.separatorChar, '/');↵ | 3 | path = path.replace(File.separatorChar, '/');↵ | |
4 | if (!path.startsWith("/")) {↵ | 4 | if (!path.startsWith("/")) {↵ | |
5 | path = "/" + path;↵ | 5 | path = "/" + path;↵ | |
6 | }↵ | 6 | }↵ | |
7 | URL url1 = new URL("file", "", path);↵ | 7 | URI uri1 = new URI("file", null, path, null);↵ | |
8 | URL url2 = f.toURL();↵ | 8 | URI uri2 = f.toURI();↵ | |
9 | assertEquals("urls not equal", url1, url2); | 9 | assertEquals("uris not equal", uri1, uri2); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 31 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 3.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | FileWrapper f = new FileWrapperImpl(System.getProperty("user.dir"), "a/b/c/../d/e/./f"); | 1 | FileWrapper f = new FileWrapperImpl(System.getProperty("user.dir"), "a/b/c/../d/e/./f"); | |||||||||||||||||||||||||
2 | String path = f.getAbsolutePath(); | 2 | String path = f.getAbsolutePath(); | |||||||||||||||||||||||||
3 | path = path.replace(File.separatorChar, '/'); | 3 | path = path.replace(File.separatorChar, '/'); | |||||||||||||||||||||||||
4 | if (!path.startsWith("/")) | 4 | if (!path.startsWith("/")) | |||||||||||||||||||||||||
5 | path = "/" + path; | 5 | path = "/" + path; | |||||||||||||||||||||||||
|
| 6 | URI uri1 = new URI("file", null, path, null); | |||||||||||||||||||||||||
6 | URL url1 = new URL("file", "", path); |
| | |||||||||||||||||||||||||
|
| 7 | URI uri2 = f.toURI(); | |||||||||||||||||||||||||
7 | URL url2 = f.toURL(); |
| | |||||||||||||||||||||||||
8 | assertEquals("urls not equal", url1, url2); |
| 8 | assertEquals("uris not equal", uri1, uri2); |
Row | Violation |
---|---|
1 | Unmatched statement URI uri1=new URI("file",null,path,null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement URL url1=new URL("file","",path); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement URI uri2=f.toURI(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement URL url2=f.toURL(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Type java.net.URL of variable url1 does not match with type java.net.URI of variable uri1 |
6 | Type java.net.URL of variable url2 does not match with type java.net.URI of variable uri2 |