public boolean hasSelectors() { return !(selectorsList.isEmpty()); } /** * Gives the count of the number of selectors in this container * @return the number of selectors */ public int selectorCount() { return selectorsList.size(); } /** * Returns the set of selectors as an array. * @param p the current project * @return an array of selectors */ public FileSelector[] getSelectors(Project p) { FileSelector[] result = new FileSelector[selectorsList.size()]; selectorsList.copyInto(result); return result; } /** * Returns an enumerator for accessing the set of selectors. * @return an enumerator for the selectors */ public Enumeration selectorElements() { return selectorsList.elements(); } /** * Convert the Selectors within this container to a string. This will * just be a helper class for the subclasses that put their own name * around the contents listed here. * * @return comma separated list of Selectors contained in this one */ public String toString() { StringBuffer buf = new StringBuffer(); Enumeration e = selectorElements(); if (e.hasMoreElements()) { while (e.hasMoreElements()) { buf.append(e.nextElement().toString()); if (e.hasMoreElements()) { buf.append(", "); } } } return buf.toString(); } /** * Add a new selector into this container. * * @param selector the new selector to add */ public void appendSelector(FileSelector selector) { selectorsList.addElement(selector);
public boolean hasSelectors() { return !(selectorsList.isEmpty()); } /** * Gives the count of the number of selectors in this container * @return the number of selectors */ public int selectorCount() { return selectorsList.size(); } /** * Returns the set of selectors as an array. * @param p the current project * @return an array of selectors */ public FileSelector[] getSelectors(Project p) { FileSelector[] result = new FileSelector[selectorsList.size()]; selectorsList.copyInto(result); return result; } /** * Returns an enumerator for accessing the set of selectors. * @return an enumerator for the selectors */ public Enumeration selectorElements() { return selectorsList.elements(); } /** * Convert the Selectors within this container to a string. This will * just be a helper class for the subclasses that put their own name * around the contents listed here. * * @return comma separated list of Selectors contained in this one */ public String toString() { StringBuffer buf = new StringBuffer(); Enumeration e = selectorElements(); if (e.hasMoreElements()) { while (e.hasMoreElements()) { buf.append(e.nextElement().toString()); if (e.hasMoreElements()) { buf.append(", "); } } } return buf.toString(); } /** * Add a new selector into this container. * * @param selector the new selector to add */ public void appendSelector(FileSelector selector) { selectorsList.addElement(selector);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/AbstractSelectorContainer.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/BaseSelectorContainer.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public boolean hasSelectors() {
1
public boolean hasSelectors() {
2
        return !(selectorsList.isEmpty());
2
        return !(selectorsList.isEmpty());
3
    }
3
    }
4
    /**
4
    /**
5
     * Gives the count of the number of selectors in this container
5
     * Gives the count of the number of selectors in this container
6
     * @return the number of selectors
6
     * @return the number of selectors
7
     */
7
     */
8
    public int selectorCount() {
8
    public int selectorCount() {
9
        return selectorsList.size();
9
        return selectorsList.size();
10
    }
10
    }
11
    /**
11
    /**
12
     * Returns the set of selectors as an array.
12
     * Returns the set of selectors as an array.
13
     * @param p the current project
13
     * @param p the current project
14
     * @return an array of selectors
14
     * @return an array of selectors
15
     */
15
     */
16
    public FileSelector[] getSelectors(Project p) {
16
    public FileSelector[] getSelectors(Project p) {
17
        FileSelector[] result = new FileSelector[selectorsList.size()];
17
        FileSelector[] result = new FileSelector[selectorsList.size()];
18
        selectorsList.copyInto(result);
18
        selectorsList.copyInto(result);
19
        return result;
19
        return result;
20
    }
20
    }
21
    /**
21
    /**
22
     * Returns an enumerator for accessing the set of selectors.
22
     * Returns an enumerator for accessing the set of selectors.
23
     * @return an enumerator for the selectors
23
     * @return an enumerator for the selectors
24
     */
24
     */
25
    public Enumeration selectorElements() {
25
    public Enumeration selectorElements() {
26
        return selectorsList.elements();
26
        return selectorsList.elements();
27
    }
27
    }
28
    /**
28
    /**
29
     * Convert the Selectors within this container to a string. This will
29
     * Convert the Selectors within this container to a string. This will
30
     * just be a helper class for the subclasses that put their own name
30
     * just be a helper class for the subclasses that put their own name
31
     * around the contents listed here.
31
     * around the contents listed here.
32
     *
32
     *
33
     * @return comma separated list of Selectors contained in this one
33
     * @return comma separated list of Selectors contained in this one
34
     */
34
     */
35
    public String toString() {
35
    public String toString() {
36
        StringBuffer buf = new StringBuffer();
36
        StringBuffer buf = new StringBuffer();
37
        Enumeration e = selectorElements();
37
        Enumeration e = selectorElements();
38
        if (e.hasMoreElements()) {
38
        if (e.hasMoreElements()) {
39
            while (e.hasMoreElements()) {
39
            while (e.hasMoreElements()) {
40
                buf.append(e.nextElement().toString());
40
                buf.append(e.nextElement().toString());
41
                if (e.hasMoreElements()) {
41
                if (e.hasMoreElements()) {
42
                    buf.append(", ");
42
                    buf.append(", ");
43
                }
43
                }
44
            }
44
            }
45
        }
45
        }
46
        return buf.toString();
46
        return buf.toString();
47
    }
47
    }
48
    /**
48
    /**
49
     * Add a new selector into this container.
49
     * Add a new selector into this container.
50
     *
50
     *
51
     * @param selector the new selector to add
51
     * @param selector the new selector to add
52
     */
52
     */
53
    public void appendSelector(FileSelector selector) {
53
    public void appendSelector(FileSelector selector) {
54
        selectorsList.addElement(selector);
54
        selectorsList.addElement(selector);
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