Object clone() { if (isReference()) { return ((TarFileSet) getRef(getProject())).clone(); } else { return super.clone(); } } /** * A check attributes for TarFileSet. * If there is a reference, and * it is a TarFileSet, the tar fileset attributes * cannot be used. */ private void checkTarFileSetAttributesAllowed() { if (getProject() == null || (isReference() && (getRefid().getReferencedObject( getProject()) instanceof TarFileSet))) { checkAttributesAllowed(); }
Object clone() { if (isReference()) { return ((ZipFileSet) getRef(getProject())).clone(); } else { return super.clone(); } } /** * A check attributes for zipFileSet. * If there is a reference, and * it is a ZipFileSet, the zip fileset attributes * cannot be used. */ private void checkZipFileSetAttributesAllowed() { if (getProject() == null || (isReference() && (getRefid().getReferencedObject( getProject()) instanceof ZipFileSet))) { checkAttributesAllowed(); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/TarFileSet.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/ZipFileSet.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
Object clone() {
1
Object clone() {
2
        if (isReference()) {
2
        if (isReference()) {
3
            return ((TarFileSet) getRef(getProject())).clone();
3
            return ((ZipFileSet) getRef(getProject())).clone();
4
        } else {
4
        } else {
5
            return super.clone();
5
            return super.clone();
6
        }
6
        }
7
    }
7
    }
8
    /**
8
    /**
9
     * A check attributes for TarFileSet.
9
     * A check attributes for zipFileSet.
10
     * If there is a reference, and
10
     * If there is a reference, and
11
     * it is a TarFileSet, the tar fileset attributes
11
     * it is a ZipFileSet, the zip fileset attributes
12
     * cannot be used.
12
     * cannot be used.
13
     */
13
     */
14
    private void checkTarFileSetAttributesAllowed() {
14
    private void checkZipFileSetAttributesAllowed() {
15
        if (getProject() == null
15
        if (getProject() == null
16
            || (isReference()
16
            || (isReference()
17
                && (getRefid().getReferencedObject(
17
                && (getRefid().getReferencedObject(
18
                        getProject())
18
                        getProject())
19
                    instanceof TarFileSet))) {
19
                    instanceof ZipFileSet))) {
20
            checkAttributesAllowed();
20
            checkAttributesAllowed();
21
        }
21
        }
22
    
22
    
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0