if (isReference()) { throw tooManyAttributes(); } if (error == null) { throw new IllegalArgumentException("error file specified as null"); } usingError = true; errorMapper = createMergeMapper(error);
if (isReference()) { throw tooManyAttributes(); } if (out == null) { throw new IllegalArgumentException("output file specified as null"); } usingOutput = true; outputMapper = createMergeMapper(out);
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 setError(File) Method name: void setOutput(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 (error == null) {
4
        if (out == null) {
5
            throw new IllegalArgumentException("error file specified as null");
5
            throw new IllegalArgumentException("output file specified as null");
6
        }
6
        }
7
        usingError = true;
7
        usingOutput = true;
8
        errorMapper = createMergeMapper(error);
8
        outputMapper = createMergeMapper(out);
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 (error == null)
    3
    if (error == null)
    3
    if (out == null)
    Differences
    Expression1Expression2Difference
    erroroutVARIABLE_NAME_MISMATCH
    3
    if (out == null)
    4
    throw new IllegalArgumentException("error file specified as null");
    4
    throw new IllegalArgumentException("error file specified as null");
    4
    throw new IllegalArgumentException("output file specified as null");
    Differences
    Expression1Expression2Difference
    "error file specified as null""output file specified as null"LITERAL_VALUE_MISMATCH
    4
    throw new IllegalArgumentException("output file specified as null");
    5
    usingError = true;
    5
    usingError = true;
    5
    usingOutput = true;
    Differences
    Expression1Expression2Difference
    usingErrorusingOutputVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression usingError is a field being modified, and thus it cannot be parameterized
    Expression usingOutput is a field being modified, and thus it cannot be parameterized
    5
    usingOutput = true;
    6
    errorMapper = createMergeMapper(error);
    6
    errorMapper = createMergeMapper(error);
    6
    outputMapper = createMergeMapper(out);
    Differences
    Expression1Expression2Difference
    errorMapperoutputMapperVARIABLE_NAME_MISMATCH
    erroroutVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression errorMapper is a field being modified, and thus it cannot be parameterized
    Expression outputMapper is a field being modified, and thus it cannot be parameterized
    6
    outputMapper = createMergeMapper(out);
    Precondition Violations (4)
    Row Violation
    1Expression usingError is a field being modified, and thus it cannot be parameterized
    2Expression usingOutput is a field being modified, and thus it cannot be parameterized
    3Expression errorMapper is a field being modified, and thus it cannot be parameterized
    4Expression outputMapper is a field being modified, and thus it cannot be parameterized