if (outputProperty != null) { redirector.setOutputProperty(outputProperty); } if (errorProperty != null) { redirector.setErrorProperty(errorProperty); } if (inputString != null) { redirector.setInputString(inputString); }
if (inputEncoding != null) { redirector.setInputEncoding(inputEncoding); } if (outputEncoding != null) { redirector.setOutputEncoding(outputEncoding); } if (errorEncoding != null) { redirector.setErrorEncoding(errorEncoding); }
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 configure(Redirector, String) Method name: void configure(Redirector, String)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (outputProperty != null) {
1
if (inputEncoding != null) {
2
            redirector.setOutputProperty(outputProperty);
2
            redirector.setInputEncoding(inputEncoding);
3
        }
3
        }
4
        if (errorProperty != null) {
4
        if (outputEncoding != null) {
5
            redirector.setErrorProperty(errorProperty);
5
            redirector.setOutputEncoding(outputEncoding);
6
        }
6
        }
7
        if (inputString != null) {
7
        if (errorEncoding != null) {
8
            redirector.setInputString(inputString);
8
            redirector.setErrorEncoding(errorEncoding);
9
        }
9
        }
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.3
Clones locationClones are in the same method
Number of node comparisons27
  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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    if (outputProperty != null)
    12
    if (outputProperty != null)
    44
    if (inputEncoding != null)
    Differences
    Expression1Expression2Difference
    outputPropertyinputEncodingVARIABLE_NAME_MISMATCH
    44
    if (inputEncoding != null)
    13
    redirector.setOutputProperty(outputProperty);
    13
    redirector.setOutputProperty(outputProperty);
    45
    redirector.setInputEncoding(inputEncoding);
    Differences
    Expression1Expression2Difference
    setOutputPropertysetInputEncodingMETHOD_INVOCATION_NAME_MISMATCH
    outputPropertyinputEncodingVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression redirector.setOutputProperty(outputProperty) is a void method call, and thus it cannot be parameterized
    Expression redirector.setInputEncoding(inputEncoding) is a void method call, and thus it cannot be parameterized
    45
    redirector.setInputEncoding(inputEncoding);
    14
    if (errorProperty != null)
    14
    if (errorProperty != null)
    46
    if (outputEncoding != null)
    Differences
    Expression1Expression2Difference
    errorPropertyoutputEncodingVARIABLE_NAME_MISMATCH
    46
    if (outputEncoding != null)
    15
    redirector.setErrorProperty(errorProperty);
    15
    redirector.setErrorProperty(errorProperty);
    47
    redirector.setOutputEncoding(outputEncoding);
    Differences
    Expression1Expression2Difference
    setErrorPropertysetOutputEncodingMETHOD_INVOCATION_NAME_MISMATCH
    errorPropertyoutputEncodingVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression redirector.setErrorProperty(errorProperty) is a void method call, and thus it cannot be parameterized
    Expression redirector.setOutputEncoding(outputEncoding) is a void method call, and thus it cannot be parameterized
    47
    redirector.setOutputEncoding(outputEncoding);
    16
    if (inputString != null)
    16
    if (inputString != null)
    48
    if (errorEncoding != null)
    Differences
    Expression1Expression2Difference
    inputStringerrorEncodingVARIABLE_NAME_MISMATCH
    48
    if (errorEncoding != null)
    17
    redirector.setInputString(inputString);
    17
    redirector.setInputString(inputString);
    49
    redirector.setErrorEncoding(errorEncoding);
    Differences
    Expression1Expression2Difference
    setInputStringsetErrorEncodingMETHOD_INVOCATION_NAME_MISMATCH
    inputStringerrorEncodingVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression redirector.setInputString(inputString) is a void method call, and thus it cannot be parameterized
    Expression redirector.setErrorEncoding(errorEncoding) is a void method call, and thus it cannot be parameterized
    49
    redirector.setErrorEncoding(errorEncoding);
    Precondition Violations (6)
    Row Violation
    1Expression redirector.setOutputProperty(outputProperty) is a void method call, and thus it cannot be parameterized
    2Expression redirector.setInputEncoding(inputEncoding) is a void method call, and thus it cannot be parameterized
    3Expression redirector.setErrorProperty(errorProperty) is a void method call, and thus it cannot be parameterized
    4Expression redirector.setOutputEncoding(outputEncoding) is a void method call, and thus it cannot be parameterized
    5Expression redirector.setInputString(inputString) is a void method call, and thus it cannot be parameterized
    6Expression redirector.setErrorEncoding(errorEncoding) is a void method call, and thus it cannot be parameterized