public class And extends ConditionBase implements Condition { /** * @return true if all the contained conditions evaluates to true * @exception BuildException if an error occurs */ public boolean eval() throws BuildException { Enumeration e = getConditions(); while (e.hasMoreElements()) { Condition c = (Condition) e.nextElement(); if (!c.eval()) { return false; } } return true;
public class Or extends ConditionBase implements Condition { /** * @return true if any of the contained conditions evaluate to true * @exception BuildException if an error occurs */ public boolean eval() throws BuildException { Enumeration e = getConditions(); while (e.hasMoreElements()) { Condition c = (Condition) e.nextElement(); if (c.eval()) { return true; } } return false;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/condition/And.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/condition/Or.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class And extends ConditionBase implements Condition {
1
public class Or extends ConditionBase implements Condition {
2
    /**
2
    /**
3
     * @return true if all the contained conditions evaluates to true
3
     * @return true if any of the contained conditions evaluate to true
4
     * @exception BuildException if an error occurs
4
     * @exception BuildException if an error occurs
5
     */
5
     */
6
    public boolean eval() throws BuildException {
6
    public boolean eval() throws BuildException {
7
        Enumeration e = getConditions();
7
        Enumeration e = getConditions();
8
        while (e.hasMoreElements()) {
8
        while (e.hasMoreElements()) {
9
            Condition c = (Condition) e.nextElement();
9
            Condition c = (Condition) e.nextElement();
10
            if (!c.eval()) {
10
            if (c.eval()) {
11
                return false;
11
                return true;
12
            }
12
            }
13
        }
13
        }
14
        return true;
14
        return false;
15
    
15
    
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