Project p = owner.getProject();
if (ifCond != null && p.getProperty(ifCond) == null) {
return false;
} else if (unlessCond != null && p.getProperty(unlessCond) != null) {
return false;
}
return true;
if (ifProperty != null && p.getProperty(ifProperty) == null) {
return false;
} else if (unlessProperty != null
&& p.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/dotnet/DotnetDefine.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTest.java
|
Method name: boolean isSet(Task)
|
|
Method name: boolean shouldRun(Project)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 5
|
|
1 | Project p = owner.getProject();↵ | | |
|
2 | if (ifCond != null && p.getProperty(ifCond) == null) {↵ | | 1 | if (ifProperty != null && p.getProperty(ifProperty) == null) {↵
|
3 | return false;↵ | | 2 | return false;↵
|
4 | } else if (unlessCond != null↵ | | 3 | } else if (unlessProperty != null↵
|
5 | && p.getProperty(unlessCond) != null) {↵ | | 4 | && p.getProperty(unlessProperty) != null) {↵
|
6 | return false;↵ | | 5 | return false;↵
|
7 | }↵ | | 6 | }↵
|
|
8 | return true; | | 7 | 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 | 15 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 0.7 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Project p = owner.getProject(); | | | |
2 | if (ifCond != null && p.getProperty(ifCond) == null) | | 1 | if (ifProperty != null && p.getProperty(ifProperty) == null) |
3 | | | 2 | |
4 | else if (unlessCond != null && p.getProperty(unlessCond) != null) | | 3 | else if (unlessProperty != null && p.getProperty(unlessProperty) != null) |
5 | | | 4 | |
6 | return true; | | 5 | return true; |
Precondition Violations (0)
Row |
Violation |