DirSet(DirSet dirset) { super(dirset); } /** * Return a DirSet that has the same basedir and same patternsets * as this one. * @return the cloned dirset. */ public Object clone() { if (isReference()) { return ((DirSet) getRef(getProject())).clone(); } else { return super.clone(); } } /** * Fulfill the ResourceCollection contract. * @return an Iterator of Resources. * @since Ant 1.7 */ public Iterator iterator() { if (isReference()) { return ((DirSet) getRef(getProject())).iterator(); } return new FileResourceIterator(getDir(getProject()), getDirectoryScanner(getProject()).getIncludedDirectories()); } /** * Fulfill the ResourceCollection contract. * @return number of elements as int. * @since Ant 1.7 */ public int size() { if (isReference()) { return ((DirSet) getRef(getProject())).size(); } return getDirectoryScanner(getProject()).getIncludedDirsCount(); } /** * Always returns true. * @return true indicating that all elements will be FileResources. * @since Ant 1.7 */ public boolean isFilesystemOnly() { return true;
FileSet(FileSet fileset) { super(fileset); } /** * Return a FileSet that has the same basedir and same patternsets * as this one. * @return the cloned fileset */ public Object clone() { if (isReference()) { return ((FileSet) getRef(getProject())).clone(); } else { return super.clone(); } } /** * Fulfill the ResourceCollection contract. * @return an Iterator of Resources. * @since Ant 1.7 */ public Iterator iterator() { if (isReference()) { return ((FileSet) getRef(getProject())).iterator(); } return new FileResourceIterator(getDir(getProject()), getDirectoryScanner(getProject()).getIncludedFiles()); } /** * Fulfill the ResourceCollection contract. * @return number of elements as int. * @since Ant 1.7 */ public int size() { if (isReference()) { return ((FileSet) getRef(getProject())).size(); } return getDirectoryScanner(getProject()).getIncludedFilesCount(); } /** * Always returns true. * @return true indicating that all elements will be FileResources. * @since Ant 1.7 */ public boolean isFilesystemOnly() { return true;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/DirSet.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/FileSet.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
DirSet(DirSet dirset) {
1
FileSet(FileSet fileset) {
2
        super(dirset);
2
        super(fileset);
3
    }
3
    }
4
    /**
4
    /**
5
     * Return a DirSet that has the same basedir and same patternsets
5
     * Return a FileSet that has the same basedir and same patternsets
6
     * as this one.
6
     * as this one.
7
     * @return the cloned dirset.
7
     * @return the cloned fileset
8
     */
8
     */
9
    public Object clone() {
9
    public Object clone() {
10
        if (isReference()) {
10
        if (isReference()) {
11
            return ((DirSet) getRef(getProject())).clone();
11
            return ((FileSet) getRef(getProject())).clone();
12
        } else {
12
        } else {
13
            return super.clone();
13
            return super.clone();
14
        }
14
        }
15
    }
15
    }
16
    /**
16
    /**
17
     * Fulfill the ResourceCollection contract.
17
     * Fulfill the ResourceCollection contract.
18
     * @return an Iterator of Resources.
18
     * @return an Iterator of Resources.
19
     * @since Ant 1.7
19
     * @since Ant 1.7
20
     */
20
     */
21
    public Iterator iterator() {
21
    public Iterator iterator() {
22
        if (isReference()) {
22
        if (isReference()) {
23
            return ((DirSet) getRef(getProject())).iterator();
23
            return ((FileSet) getRef(getProject())).iterator();
24
        }
24
        }
25
        return new FileResourceIterator(getDir(getProject()),
25
        return new FileResourceIterator(getDir(getProject()),
26
            getDirectoryScanner(getProject()).getIncludedDirectories());
26
            getDirectoryScanner(getProject()).getIncludedFiles());
27
    }
27
    }
28
    /**
28
    /**
29
     * Fulfill the ResourceCollection contract.
29
     * Fulfill the ResourceCollection contract.
30
     * @return number of elements as int.
30
     * @return number of elements as int.
31
     * @since Ant 1.7
31
     * @since Ant 1.7
32
     */
32
     */
33
    public int size() {
33
    public int size() {
34
        if (isReference()) {
34
        if (isReference()) {
35
            return ((DirSet) getRef(getProject())).size();
35
            return ((FileSet) getRef(getProject())).size();
36
        }
36
        }
37
        return getDirectoryScanner(getProject()).getIncludedDirsCount();
37
        return getDirectoryScanner(getProject()).getIncludedFilesCount();
38
    }
38
    }
39
    /**
39
    /**
40
     * Always returns true.
40
     * Always returns true.
41
     * @return true indicating that all elements will be FileResources.
41
     * @return true indicating that all elements will be FileResources.
42
     * @since Ant 1.7
42
     * @since Ant 1.7
43
     */
43
     */
44
    public boolean isFilesystemOnly() {
44
    public boolean isFilesystemOnly() {
45
        return true;
45
        return true;
46
    
46
    
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