if (isReference()) { throw tooManyAttributes(); } if (out == null) { throw new IllegalArgumentException("output file specified as null"); } usingOutput = true; outputMapper = createMergeMapper(out);
if (isReference()) { throw tooManyAttributes(); } if (error == null) { throw new IllegalArgumentException("error file specified as null"); } usingError = true; errorMapper = createMergeMapper(error);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/RedirectorElement.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/RedirectorElement.java
Method name: void setOutput(File) Method name: void setError(File)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (isReference()) {
1
if (isReference()) {
2
            throw tooManyAttributes();
2
            throw tooManyAttributes();
3
        }
3
        }
4
        if (out == null) {
4
        if (error == null) {
5
            throw new IllegalArgumentException("output file specified as null");
5
            throw new IllegalArgumentException("error file specified as null");
6
        }
6
        }
7
        usingOutput = true;
7
        usingError = true;
8
        outputMapper = createMergeMapper(out);
8
        errorMapper = createMergeMapper(error);
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 comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isReference())
    1
    if (isReference())
    2
    throw tooManyAttributes();
    2
    throw tooManyAttributes();
    3
    if (out == null)
    3
    if (out == null)
    3
    if (error == null)
    Differences
    Expression1Expression2Difference
    outerrorVARIABLE_NAME_MISMATCH
    3
    if (error == null)
    4
    throw new IllegalArgumentException("output file specified as null");
    4
    throw new IllegalArgumentException("output file specified as null");
    4
    throw new IllegalArgumentException("error file specified as null");
    Differences
    Expression1Expression2Difference
    "output file specified as null""error file specified as null"LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("error file specified as null");
    5
    usingOutput = true;
    5
    usingOutput = true;
    5
    usingError = true;
    Differences
    Expression1Expression2Difference
    usingOutputusingErrorVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression usingOutput is a field being modified, and thus it cannot be parameterized
    Expression usingError is a field being modified, and thus it cannot be parameterized
    5
    usingError = true;
    6
    outputMapper = createMergeMapper(out);
    6
    outputMapper = createMergeMapper(out);
    6
    errorMapper = createMergeMapper(error);
    Differences
    Expression1Expression2Difference
    outputMappererrorMapperVARIABLE_NAME_MISMATCH
    outerrorVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression outputMapper is a field being modified, and thus it cannot be parameterized
    Expression errorMapper is a field being modified, and thus it cannot be parameterized
    6
    errorMapper = createMergeMapper(error);
    Precondition Violations (4)
    Row Violation
    1Expression usingOutput is a field being modified, and thus it cannot be parameterized
    2Expression usingError is a field being modified, and thus it cannot be parameterized
    3Expression outputMapper is a field being modified, and thus it cannot be parameterized
    4Expression errorMapper is a field being modified, and thus it cannot be parameterized