inerr = unwrapBufferedStream(child.getErrorStream()); if (inerr instanceof FileInputStream) { inerrChannel = ((FileInputStream) inerr).getChannel(); } else { inerrChannel = null; } inerrPumper = null;
input = unwrapBufferedStream(child.getInputStream()); if (input instanceof FileInputStream) { inputChannel = ((FileInputStream) input).getChannel(); } else { inputChannel = null; } inputPumper = null;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/util/ShellLauncher.java File path: /jruby-1.4.0/src/org/jruby/util/ShellLauncher.java
Method name: void prepareInerr(Process) Method name: void prepareInput(Process)
Number of AST nodes: 5 Number of AST nodes: 5
1
inerr = unwrapBufferedStream(child.getErrorStream());
1
input = unwrapBufferedStream(child.getInputStream());
2
            if (inerr instanceof FileInputStream) {
2
            if (input instanceof FileInputStream) {
3
                inerrChannel = ((FileInputStream) inerr).getChannel();
3
                inputChannel = ((FileInputStream) input).getChannel();
4
            } else {
4
            } else {
5
                inerrChannel = null;
5
                inputChannel = null;
6
            }
6
            }
7
            inerrPumper = null;
7
            inputPumper = null;
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.1
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    inerr = unwrapBufferedStream(child.getErrorStream());
    1
    inerr = unwrapBufferedStream(child.getErrorStream());
    1
    input = unwrapBufferedStream(child.getInputStream());
    Differences
    Expression1Expression2Difference
    inerrinputVARIABLE_NAME_MISMATCH
    getErrorStreamgetInputStreamMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression inerr is a field being modified, and thus it cannot be parameterized
    Expression input is a field being modified, and thus it cannot be parameterized
    1
    input = unwrapBufferedStream(child.getInputStream());
    2
    if (inerr instanceof FileInputStream)
    2
    if (inerr instanceof FileInputStream)
    2
    if (input instanceof FileInputStream)
    Differences
    Expression1Expression2Difference
    inerrinputVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression inerr cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression input cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    if (input instanceof FileInputStream)
    3
    inerrChannel = ((FileInputStream)inerr).getChannel();
    3
    inerrChannel = ((FileInputStream)inerr).getChannel();
    3
    inputChannel = ((FileInputStream)input).getChannel();
    Differences
    Expression1Expression2Difference
    inerrChannelinputChannelVARIABLE_NAME_MISMATCH
    inerrinputVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression inerrChannel is a field being modified, and thus it cannot be parameterized
    Expression inputChannel is a field being modified, and thus it cannot be parameterized
    Expression inerr cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression input cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    inputChannel = ((FileInputStream)input).getChannel();
    else
    else
    4
    inerrChannel = null;
    4
    inerrChannel = null;
    4
    inputChannel = null;
    Differences
    Expression1Expression2Difference
    inerrChannelinputChannelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression inerrChannel is a field being modified, and thus it cannot be parameterized
    Expression inputChannel is a field being modified, and thus it cannot be parameterized
    4
    inputChannel = null;
    5
    inerrPumper = null;
    5
    inerrPumper = null;
    5
    inputPumper = null;
    Differences
    Expression1Expression2Difference
    inerrPumperinputPumperVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression inerrPumper is a field being modified, and thus it cannot be parameterized
    Expression inputPumper is a field being modified, and thus it cannot be parameterized
    5
    inputPumper = null;
    Precondition Violations (12)
    Row Violation
    1Expression inerr is a field being modified, and thus it cannot be parameterized
    2Expression input is a field being modified, and thus it cannot be parameterized
    3Expression inerr cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression input cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression inerrChannel is a field being modified, and thus it cannot be parameterized
    6Expression inputChannel is a field being modified, and thus it cannot be parameterized
    7Expression inerr cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression input cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression inerrChannel is a field being modified, and thus it cannot be parameterized
    10Expression inputChannel is a field being modified, and thus it cannot be parameterized
    11Expression inerrPumper is a field being modified, and thus it cannot be parameterized
    12Expression inputPumper is a field being modified, and thus it cannot be parameterized