while (e.hasMoreElements()) {
result = ((FileSelector) e.nextElement()).isSelected(basedir,
filename, file);
if (result) {
return true;
}
}
if (getNext() != null) {
boolean subst = getNext().setPropertyHook(ns, name, value,
inherited, user, isNew);
// If next has handled the property
if (subst) {
return true;
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/OrSelector.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/PropertyHelper.java
|
Method name: boolean isSelected(File, String, File)
|
|
Method name: boolean setPropertyHook(String, String, Object, boolean, boolean, boolean)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | while (e.hasMoreElements()) {↵ | | |
|
2 | result = ((FileSelector) e.nextElement()).isSelected(basedir↵ | | 1 | if (getNext() != null) {↵
|
3 | ,↵ | | 2 | boolean subst = getNext().setPropertyHook(ns, name, value,↵
|
4 | filename, file);↵ | | 3 | ↵
|
5 | if (resul↵ | | 4 | inherited, user, isNew);↵
|
| | | 5 | // If next has handled the property↵
|
6 | t) {↵ | | 6 | if (subst) {↵
|
7 | return true;↵ | | 7 | return true;↵
|
8 | }↵ | | 8 | }↵
|
9 | } | | 9 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 2 | boolean subst = getNext().setPropertyHook(ns, name, value, inherited, user, isNew); |
5 | result = ((FileSelector)e.nextElement()).isSelected(basedir, filename, file); | | | |
6 | if (result) | | 3 | if (subst) |
7 | | | 4 | |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched statement result=((FileSelector)e.nextElement()).isSelected(basedir,filename,file); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |