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());
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());
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: 4
|
|
Number of AST nodes: 4
|
|
1 | if (getProject().getProperty("wc.can.run") == null) {↵ | | 1 | if (getProject().getProperty("wc.can.run") == null) {↵
|
2 | return;↵ | | 2 | return;↵
|
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",↵ | | 5 | assertEquals("property redirect.out", "3",↵
|
6 | getProject().getProperty("redirect.out").trim()); | | 6 | getProject().getProperty("redirect.out").trim());
|
See real code fragment |
|
See real code fragment |
Summary
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 | 8 |
-
{Non-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) | 0.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
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()); |
Precondition Violations (2)
Row |
Violation |
1 | Conditional return; |
2 | Conditional return; |