public class IsFalse extends ProjectComponent implements Condition { /** * what we eval */ private Boolean value = null; /** * set the value to be tested; let ant eval it to true/false * @param value the value to test */ public void setValue(boolean value) { this.value = value ? Boolean.TRUE : Boolean.FALSE; } /** * @return the inverted value; * @throws BuildException if someone forgot to spec a value */ public boolean eval() throws BuildException { if (value == null) { throw new BuildException("Nothing to test for falsehood"); } return !value.booleanValue();
public class IsTrue extends ProjectComponent implements Condition { /** * what we eval */ private Boolean value = null; /** * set the value to be tested; let ant eval it to true/false * @param value the value to test */ public void setValue(boolean value) { this.value = value ? Boolean.TRUE : Boolean.FALSE; } /** * @return the value * @throws BuildException if someone forgot to spec a value */ public boolean eval() throws BuildException { if (value == null) { throw new BuildException("Nothing to test for truth"); } return value.booleanValue();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/condition/IsFalse.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/condition/IsTrue.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class IsFalse extends ProjectComponent implements Condition {
1
public class IsTrue extends ProjectComponent implements Condition {
2
    /**
2
    /**
3
     * what we eval
3
     * what we eval
4
     */
4
     */
5
    private Boolean value = null;
5
    private Boolean value = null;
6
    /**
6
    /**
7
     * set the value to be tested; let ant eval it to true/false
7
     * set the value to be tested; let ant eval it to true/false
8
     * @param value the value to test
8
     * @param value the value to test
9
     */
9
     */
10
    public void setValue(boolean value) {
10
    public void setValue(boolean value) {
11
        this.value = value ? Boolean.TRUE : Boolean.FALSE;
11
        this.value = value ? Boolean.TRUE : Boolean.FALSE;
12
    }
12
    }
13
    /**
13
    /**
14
     * @return the inverted value;
14
     * @return the value
15
     * @throws BuildException if someone forgot to spec a value
15
     * @throws BuildException if someone forgot to spec a value
16
     */
16
     */
17
    public boolean eval() throws BuildException {
17
    public boolean eval() throws BuildException {
18
        if (value == null) {
18
        if (value == null) {
19
            throw new BuildException("Nothing to test for falsehood");
19
            throw new BuildException("Nothing to test for truth");
20
        }
20
        }
21
        return !value.booleanValue();
21
        return value.booleanValue();
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