File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/PathTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/PathTest.java | |||
Method name: void testConstructorUnixStyle()
|
Method name: void testConstructorWindowsStyle()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | Path p = new Path(project, "/a:/b");↵ | 1 | Path p = new Path(project, "\\a;\\b");↵ | |
2 | String[] l = p.list();↵ | 2 | String[] l = p.list();↵ | |
3 | assertEquals("two items, Unix style", 2, l.length);↵ | 3 | assertEquals("two items, DOS style", 2, l.length);↵ | |
4 | if (isUnixStyle) {↵ | 4 | if (isUnixStyle) {↵ | |
5 | assertEquals("/a", l[0]);↵ | 5 | assertEquals("/a", l[0]);↵ | |
6 | assertEquals("/b", l[1]);↵ | 6 | assertEquals("/b", l[1]);↵ | |
7 | } else if (isNetWare) {↵ | 7 | } else if (isNetWare) {↵ | |
8 | assertEquals("\\a", l[0]);↵ | 8 | assertEquals("\\a", l[0]);↵ | |
9 | assertEquals("\\b", l[1]);↵ | 9 | assertEquals("\\b", l[1]);↵ | |
10 | } else {↵ | 10 | } else {↵ | |
11 | String base = new File(File.separator).getAbsolutePath();↵ | 11 | String base = new File(File.separator).getAbsolutePath();↵ | |
12 | assertEquals(base + "a", l[0]);↵ | 12 | assertEquals(base + "a", l[0]);↵ | |
13 | assertEquals(base + "b", l[1]);↵ | 13 | assertEquals(base + "b", l[1]);↵ | |
14 | } | 14 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 69 |
Number of mapped statements | 12 |
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) | 5.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Path p = new Path(project, "/a:/b"); |
| 1 | Path p = new Path(project, "\\a;\\b"); | ||||||||||
2 | String[] l = p.list(); | 2 | String[] l = p.list(); | |||||||||||
3 | assertEquals("two items, Unix style", 2, l.length); |
| 3 | assertEquals("two items, DOS style", 2, l.length); | ||||||||||
4 | if (isUnixStyle) | 4 | if (isUnixStyle) | |||||||||||
5 | assertEquals("/a", l[0]); | 5 | assertEquals("/a", l[0]); | |||||||||||
6 | assertEquals("/b", l[1]); | 6 | assertEquals("/b", l[1]); | |||||||||||
7 | else if (isNetWare) | 7 | else if (isNetWare) | |||||||||||
8 | assertEquals("\\a", l[0]); | 8 | assertEquals("\\a", l[0]); | |||||||||||
9 | assertEquals("\\b", l[1]); | 9 | assertEquals("\\b", l[1]); | |||||||||||
else | else | |||||||||||||
10 | String base = new File(File.separator).getAbsolutePath(); | 10 | String base = new File(File.separator).getAbsolutePath(); | |||||||||||
11 | assertEquals(base + "a", l[0]); | 11 | assertEquals(base + "a", l[0]); | |||||||||||
12 | assertEquals(base + "b", l[1]); | 12 | assertEquals(base + "b", l[1]); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables p, l |