String toString() { if (isReference()) { return getCheckedRef().toString(); } if (cacheCollection().size() == 0) { return ""; } StringBuffer sb = new StringBuffer(); for (Iterator i = coll.iterator(); i.hasNext();) { if (sb.length() > 0) { sb.append(File.pathSeparatorChar); } sb.append(i.next()); } return sb.toString(); } private synchronized Collection cacheCollection() { if (coll == null || !isCache()) { coll = getCollection(); } return coll;
String toString() { if (isReference()) { return getCheckedRef().toString(); } if (cacheCollection().size() == 0) { return ""; } StringBuffer sb = new StringBuffer(); for (Iterator i = coll.iterator(); i.hasNext();) { if (sb.length() > 0) { sb.append(File.pathSeparatorChar); } sb.append(i.next()); } return sb.toString(); } private synchronized Collection cacheCollection() { if (coll == null || !isCache()) { coll = getCollection(); } return coll;
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
String toString() {
1
String toString() {
2
        if (isReference()) {
2
        if (isReference()) {
3
            return getCheckedRef().toString();
3
            return getCheckedRef().toString();
4
        }
4
        }
5
        if (cacheCollection().size() == 0) {
5
        if (cacheCollection().size() == 0) {
6
            return "";
6
            return "";
7
        }
7
        }
8
        StringBuffer sb = new StringBuffer();
8
        StringBuffer sb = new StringBuffer();
9
        for (Iterator i = coll.iterator(); i.hasNext();) {
9
        for (Iterator i = coll.iterator(); i.hasNext();) {
10
            if (sb.length() > 0) {
10
            if (sb.length() > 0) {
11
                sb.append(File.pathSeparatorChar);
11
                sb.append(File.pathSeparatorChar);
12
            }
12
            }
13
            sb.append(i.next());
13
            sb.append(i.next());
14
        }
14
        }
15
        return sb.toString();
15
        return sb.toString();
16
    }
16
    }
17
    private synchronized Collection cacheCollection() {
17
    private synchronized Collection cacheCollection() {
18
        if (coll == null || !isCache()) {
18
        if (coll == null || !isCache()) {
19
            coll = getCollection();
19
            coll = getCollection();
20
        }
20
        }
21
        return coll;
21
        return coll;
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