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 cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.4
Clones locationClones are in the same method
Number of node comparisons27
  1. {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)19.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    if (outputProperty != null)
    12
    if (outputProperty != null)
    46
    if (outputEncoding != null)
    Differences
    Expression1Expression2Difference
    outputPropertyoutputEncodingVARIABLE_NAME_MISMATCH
    46
    if (outputEncoding != null)
    13
    redirector.setOutputProperty(outputProperty);
    13
    redirector.setOutputProperty(outputProperty);
    47
    redirector.setOutputEncoding(outputEncoding);
    Differences
    Expression1Expression2Difference
    outputPropertyoutputEncodingVARIABLE_NAME_MISMATCH
    setOutputPropertysetOutputEncodingMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression redirector.setOutputProperty(outputProperty) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression redirector.setOutputEncoding(outputEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression redirector.setOutputProperty(outputProperty) 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);
    14
    if (errorProperty != null)
    14
    if (errorProperty != null)
    48
    if (errorEncoding != null)
    Differences
    Expression1Expression2Difference
    errorPropertyerrorEncodingVARIABLE_NAME_MISMATCH
    48
    if (errorEncoding != null)
    15
    redirector.setErrorProperty(errorProperty);
    15
    redirector.setErrorProperty(errorProperty);
    49
    redirector.setErrorEncoding(errorEncoding);
    Differences
    Expression1Expression2Difference
    errorPropertyerrorEncodingVARIABLE_NAME_MISMATCH
    setErrorPropertysetErrorEncodingMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression redirector.setErrorProperty(errorProperty) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression redirector.setErrorEncoding(errorEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression redirector.setErrorProperty(errorProperty) 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);
    16
    if (inputString != null)
    16
    if (inputString != null)
    44
    if (inputEncoding != null)
    Differences
    Expression1Expression2Difference
    inputStringinputEncodingVARIABLE_NAME_MISMATCH
    44
    if (inputEncoding != null)
    17
    redirector.setInputString(inputString);
    17
    redirector.setInputString(inputString);
    45
    redirector.setInputEncoding(inputEncoding);
    Differences
    Expression1Expression2Difference
    inputStringinputEncodingVARIABLE_NAME_MISMATCH
    setInputStringsetInputEncodingMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression redirector.setInputString(inputString) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression redirector.setInputEncoding(inputEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression redirector.setInputString(inputString) 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);
    Precondition Violations (12)
    Row Violation
    1Expression redirector.setOutputProperty(outputProperty) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression redirector.setOutputEncoding(outputEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression redirector.setOutputProperty(outputProperty) 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.setErrorProperty(errorProperty) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression redirector.setErrorEncoding(errorEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression redirector.setErrorProperty(errorProperty) is a void method call, and thus it cannot be parameterized
    8Expression redirector.setErrorEncoding(errorEncoding) is a void method call, and thus it cannot be parameterized
    9Expression redirector.setInputString(inputString) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression redirector.setInputEncoding(inputEncoding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression redirector.setInputString(inputString) is a void method call, and thus it cannot be parameterized
    12Expression redirector.setInputEncoding(inputEncoding) is a void method call, and thus it cannot be parameterized