String[] s = c2.getCommandline();
assertEquals(expected.length, s.length);
for (int j = 1; j < expected.length; j++) {
assertEquals(expected[j], s[j]);
}
String[] s = c.getCommandline();
assertEquals(expected.length, s.length);
for (int j = 1; j < expected.length; j++) {
assertEquals(expected[j], s[j]);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/CommandlineJavaTest.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/CommandlineJavaTest.java
|
Method name: void testAssertions()
|
|
Method name: void testAssertions()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | String[] s = c2.getCommandline();↵ | | 1 | String[] s = c.getCommandline();↵
|
2 | assertEquals(expected.length, s.length);↵ | | 2 | assertEquals(expected.length, s.length);↵
|
3 | for (int j = 1; j < expected.length; j++) {↵ | | 3 | for (int j = 1; j < expected.length; j++) {↵
|
4 | assertEquals(expected[j], s[j]);↵ | | 4 | assertEquals(expected[j], s[j]);↵
|
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 8 |
-
{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) | 1.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
20 | String[] s = c2.getCommandline(); | | 15 | String[] s = c.getCommandline(); |
21 | assertEquals(expected.length, s.length); | | 16 | assertEquals(expected.length, s.length); |
22 | for (int j = 1; j < expected.length; j++) | | 17 | for (int j = 1; j < expected.length; j++) |
23 | assertEquals(expected[j], s[j]); | | 18 | assertEquals(expected[j], s[j]); |
Precondition Violations (0)
Row |
Violation |