executeTarget(target);
if (getProject().getProperty("wc.can.run") == null) {
return;
}
assertEquals("unexpected output", "3", getFileString("redirect.out").trim());
assertEquals("property redirect.out", "3",
getProject().getProperty("redirect.out").trim());
assertNull("unexpected error output", getFileString("redirect.err"));
assertPropertyEquals("redirect.err", "");
executeTarget("redirect7");
if (getProject().getProperty("wc.can.run") == null) {
return;
}
assertEquals("unexpected output", "3", getFileString("redirect.out").trim());
assertEquals("property redirect.out", "3",
getProject().getProperty("redirect.out").trim());
assertNull("unexpected error output", getFileString("redirect.err"));
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java
|
Method name: void testRedirect5or6(String)
|
|
Method name: void testRedirect7()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 6
|
|
1 | executeTarget(target);↵ | | 1 | executeTarget("redirect7");↵
|
2 | if (getProject().getProperty("wc.can.run") == null) {↵ | | 2 | if (getProject().getProperty("wc.can.run") == null) {↵
|
3 | return;↵ | | 3 | return;↵
|
4 | }↵ | | 4 | }↵
|
|
5 | assertEquals("unexpected output", "3", getFileString("redirect.out").trim());↵ | | 5 | assertEquals("unexpected output", "3", getFileString("redirect.out").trim());↵
|
6 | assertEquals("property redirect.out", "3",↵ | | 6 | assertEquals("property redirect.out", "3",↵
|
7 | getProject().getProperty("redirect.out").trim());↵ | | 7 | getProject().getProperty("redirect.out").trim());↵
|
8 | assertNull("unexpected error output", getFileString("redirect.err"));↵ | | 8 | assertNull("unexpected error output", getFileString("redirect.err"));
|
9 | assertPropertyEquals("redirect.err", ""); | | | |
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 declared in the same class |
Number of node comparisons | 24 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.0 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | executeTarget(target); | | 1 | executeTarget("redirect7"); |
2 | if (getProject().getProperty("wc.can.run") == null) | | 2 | if (getProject().getProperty("wc.can.run") == null) |
3 | | | 3 | |
4 | assertEquals("unexpected output", "3", getFileString("redirect.out").trim()); | | 4 | assertEquals("unexpected output", "3", getFileString("redirect.out").trim()); |
5 | assertEquals("property redirect.out", "3", getProject().getProperty("redirect.out").trim()); | | 5 | assertEquals("property redirect.out", "3", getProject().getProperty("redirect.out").trim()); |
6 | assertNull("unexpected error output", getFileString("redirect.err")); | | 6 | assertNull("unexpected error output", getFileString("redirect.err")); |
7 | assertPropertyEquals("redirect.err", ""); | | | |
Precondition Violations (0)
Row |
Violation |