if (isReference()) { AbstractFileSet ref = getRef(getProject()); if (ref instanceof ZipFileSet) { return ((ZipFileSet) ref).getEncoding(); } else { return null; } }
if (src instanceof FileResource) { return ((FileResource) src).getFile(); } else { return null; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/ZipFileSet.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/XmlProperty.java
Method name: String getEncoding() Method name: File getFile()
Number of AST nodes: 5 Number of AST nodes: 3
1
if (isReference()) {
1
if (
2
            AbstractFileSet ref = getRef(getProject());
3
            if (ref instanceof ZipFileSet) {
2
src instanceof File
4
    
3
Resource) {
5
            return ((ZipFileSet) ref).getEncoding();
4
            return ((FileResource) src).getFile();
6
            } else {
5
        } else {
7
                return null;
6
            return null;
8
            }
9
        }
7
        }
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    AbstractFileSet ref = getRef(getProject());
                                                                                            
    3
    if (ref instanceof ZipFileSet)
    3
    if (ref instanceof ZipFileSet)
    1
    if (src instanceof FileResource)
    Differences
    Expression1Expression2Difference
    refsrcVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.AbstractFileSetorg.apache.tools.ant.types.ResourceSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.types.ZipFileSetorg.apache.tools.ant.types.resources.FileResourceSUBCLASS_TYPE_MISMATCH
    1
    if (src instanceof FileResource)
                                                                                    
    2
    return ((FileResource)src).getFile();
    Preondition Violations
    Unmatched return ((FileResource)src).getFile();
    2
    return ((FileResource)src).getFile();
    4
    return ((ZipFileSet)ref).getEncoding();
    4
    return ((ZipFileSet)ref).getEncoding();
    Preondition Violations
    Unmatched return ((ZipFileSet)ref).getEncoding();
                                                                                        
    else
    else
    5
    return null;
    3
    return null;
    Precondition Violations (2)
    Row Violation
    1Unmatched return ((FileResource)src).getFile();
    2Unmatched return ((ZipFileSet)ref).getEncoding();