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
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 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);
    5
    result = ((FileSelector)e.nextElement()).isSelected(basedir, filename, file);
    Preondition Violations
    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
                                                                                                                                                            
    6
    if (result)
    6
    if (result)
    3
    if (subst)
    Differences
    Expression1Expression2Difference
    resultsubstVARIABLE_NAME_MISMATCH
    3
    if (subst)
    7
    return true;
    4
    return true;
    Precondition Violations (1)
    Row Violation
    1Unmatched 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