if (errorEncoding == null) { throw new IllegalArgumentException( "errorEncoding must not be null"); } else { this.errorEncoding = errorEncoding; }
if (outputEncoding == null) { throw new IllegalArgumentException( "outputEncoding must not be null"); } else { this.outputEncoding = outputEncoding; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Redirector.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Redirector.java
Method name: void setErrorEncoding(String) Method name: void setOutputEncoding(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (errorEncoding == null) {
1
if (outputEncoding == null) {
2
            throw new IllegalArgumentException(
2
            throw new IllegalArgumentException(
3
                "errorEncoding must not be null");
3
                "outputEncoding must not be null");
4
        } else {
4
        } else {
5
            this.errorEncoding = errorEncoding;
5
            this.outputEncoding = outputEncoding;
6
        }
6
        }
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 comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (errorEncoding == null)
    1
    if (errorEncoding == null)
    1
    if (outputEncoding == null)
    Differences
    Expression1Expression2Difference
    errorEncodingoutputEncodingVARIABLE_NAME_MISMATCH
    1
    if (outputEncoding == null)
    2
    throw new IllegalArgumentException("errorEncoding must not be null");
    2
    throw new IllegalArgumentException("errorEncoding must not be null");
    2
    throw new IllegalArgumentException("outputEncoding must not be null");
    Differences
    Expression1Expression2Difference
    "errorEncoding must not be null""outputEncoding must not be null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("outputEncoding must not be null");
    else
    else
    3
    this.errorEncoding = errorEncoding;
    3
    this.errorEncoding = errorEncoding;
    3
    this.outputEncoding = outputEncoding;
    Differences
    Expression1Expression2Difference
    errorEncodingoutputEncodingVARIABLE_NAME_MISMATCH
    errorEncodingoutputEncodingVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.errorEncoding is a field being modified, and thus it cannot be parameterized
    Expression this.outputEncoding is a field being modified, and thus it cannot be parameterized
    3
    this.outputEncoding = outputEncoding;
    Precondition Violations (2)
    Row Violation
    1Expression this.errorEncoding is a field being modified, and thus it cannot be parameterized
    2Expression this.outputEncoding is a field being modified, and thus it cannot be parameterized