if (ifProperty != null && p.getProperty(ifProperty) == null) {
return false;
} else if (unlessProperty != null
&& p.getProperty(unlessProperty) != null) {
return false;
}
return true;
if (ifProperty != null && project.getProperty(ifProperty) == null) {
return false;
} else if (unlessProperty != null
&& project.getProperty(unlessProperty) != null) {
return false;
}
return true;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/XSLTProcess.java
|
Method name: boolean shouldRun(Project)
|
|
Method name: boolean shouldUse()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (ifProperty != null && p.getProperty(ifProperty) == null) {↵ | | 1 | if (ifProperty != null && project.getProperty(ifProperty) == null) {↵
|
2 | return false;↵ | | 2 | return false;↵
|
3 | } else if (unlessProperty != null↵ | | 3 | } else if (unlessProperty != null↵
|
4 | && p.getProperty(unlessProperty) != null) {↵ | | 4 | && project.getProperty(unlessProperty) != null) {↵
|
5 | return false;↵ | | 5 | return false;↵
|
6 | }↵ | | 6 | ↵
|
|
| | | 7 | }↵
|
|
7 | return true; | | 8 | return true;
|
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.8 |
Clones location | Clones are in different classes |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (ifProperty != null && p.getProperty(ifProperty) == null) | | 1 | if (ifProperty != null && project.getProperty(ifProperty) == null) |
2 | | | 2 | |
3 | else if (unlessProperty != null && p.getProperty(unlessProperty) != null) | | 3 | else if (unlessProperty != null && project.getProperty(unlessProperty) != null) |
4 | | | 4 | |
5 | return true; | | 5 | return true; |
Precondition Violations (0)
Row |
Violation |