Iterator iterator() { if (isReference()) { return ((BaseResourceCollectionContainer) getCheckedRef()).iterator(); } dieOnCircularReference(); return new FailFast(this, cacheCollection().iterator()); } /** * Fulfill the ResourceCollection contract. * @return number of elements as int. */ public synchronized int size() { if (isReference()) { return ((BaseResourceCollectionContainer) getCheckedRef()).size(); } dieOnCircularReference(); return cacheCollection().size();
Iterator iterator() { if (isReference()) { return ((BaseResourceCollectionWrapper) getCheckedRef()).iterator(); } dieOnCircularReference(); return new FailFast(this, cacheCollection().iterator()); } /** * Fulfill the ResourceCollection contract. * @return number of elements as int. */ public synchronized int size() { if (isReference()) { return ((BaseResourceCollectionWrapper) getCheckedRef()).size(); } dieOnCircularReference(); return cacheCollection().size();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/BaseResourceCollectionContainer.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/BaseResourceCollectionWrapper.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
Iterator iterator() {
1
Iterator iterator() {
2
        if (isReference()) {
2
        if (isReference()) {
3
            return ((BaseResourceCollectionContainer) getCheckedRef()).iterator();
3
            return ((BaseResourceCollectionWrapper) getCheckedRef()).iterator();
4
        }
4
        }
5
        dieOnCircularReference();
5
        dieOnCircularReference();
6
        return new FailFast(this, cacheCollection().iterator());
6
        return new FailFast(this, cacheCollection().iterator());
7
    }
7
    }
8
    /**
8
    /**
9
     * Fulfill the ResourceCollection contract.
9
     * Fulfill the ResourceCollection contract.
10
     * @return number of elements as int.
10
     * @return number of elements as int.
11
     */
11
     */
12
    public synchronized int size() {
12
    public synchronized int size() {
13
        if (isReference()) {
13
        if (isReference()) {
14
            return ((BaseResourceCollectionContainer) getCheckedRef()).size();
14
            return ((BaseResourceCollectionWrapper) getCheckedRef()).size();
15
        }
15
        }
16
        dieOnCircularReference();
16
        dieOnCircularReference();
17
        return cacheCollection().size();
17
        return cacheCollection().size();
18
    
18
    
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