line = line.trim(); if (line.length() != 0 && !line.equals(randomOutValue)) { String message = "Received = [" + line + "], expected = [" + randomOutValue + "]"; throw new BuildException(message); } outputReceived = true;
line = line.trim(); if (line.length() != 0 && !line.equals(randomErrValue)) { String message = "Received = [" + line + "], expected = [" + randomErrValue + "]"; throw new BuildException(message); } errorReceived = true;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/DemuxOutputTask.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/DemuxOutputTask.java
Method name: void handleOutput(String) Method name: void handleErrorOutput(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
line = line.trim();
1
line = line.trim();
2
        if (line.length() != 0 && !line.equals(randomOutValue)) {
2
        if (line.length() != 0 && !line.equals(randomErrValue)) {
3
            String message = "Received = [" + line + "], expected = ["
3
            String message = "Received = [" + line + "], expected = ["
4
                + randomOutValue + "]";
4
                + randomErrValue + "]";
5
            throw new BuildException(message);
5
            throw new BuildException(message);
6
        }
6
        }
7
        outputReceived = true;
7
        errorReceived = true;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    line = line.trim();
    1
    line = line.trim();
    2
    if (line.length() != 0 && !line.equals(randomOutValue))
    2
    if (line.length() != 0 && !line.equals(randomOutValue))
    2
    if (line.length() != 0 && !line.equals(randomErrValue))
    Differences
    Expression1Expression2Difference
    randomOutValuerandomErrValueVARIABLE_NAME_MISMATCH
    2
    if (line.length() != 0 && !line.equals(randomErrValue))
    3
    String message = "Received = [" + line + "], expected = [" + randomOutValue + "]";
    3
    String message = "Received = [" + line + "], expected = [" + randomOutValue + "]";
    3
    String message = "Received = [" + line + "], expected = [" + randomErrValue + "]";
    Differences
    Expression1Expression2Difference
    randomOutValuerandomErrValueVARIABLE_NAME_MISMATCH
    3
    String message = "Received = [" + line + "], expected = [" + randomErrValue + "]";
    4
    throw new BuildException(message);
    4
    throw new BuildException(message);
    5
    outputReceived = true;
    5
    outputReceived = true;
    5
    errorReceived = true;
    Differences
    Expression1Expression2Difference
    outputReceivederrorReceivedVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression outputReceived is a field being modified, and thus it cannot be parameterized
    Expression errorReceived is a field being modified, and thus it cannot be parameterized
    5
    errorReceived = true;
    Precondition Violations (2)
    Row Violation
    1Expression outputReceived is a field being modified, and thus it cannot be parameterized
    2Expression errorReceived is a field being modified, and thus it cannot be parameterized