String s = line.toString(); task.log(s, msgOutputLevel); line = new StringBuffer();
String output = buffer.toString(); project.demuxFlush(output, isErrorStream); resetBufferInfo();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/TaskOutputStream.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/DemuxOutputStream.java
Method name: void processLine() Method name: void processFlush(ByteArrayOutputStream)
Number of AST nodes: 3 Number of AST nodes: 3
1
String s = line.toString();
1
String output = buffer.toString();
2
        task.log(s, msgOutputLevel);
2
        
3
        line = new String
3
project.demuxFlush(output, isErrorStream);
4
Buffer();
4
        resetBufferInfo();
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String s = line.toString();
    1
    String s = line.toString();
    1
    String output = buffer.toString();
    Differences
    Expression1Expression2Difference
    soutputVARIABLE_NAME_MISMATCH
    linebufferVARIABLE_NAME_MISMATCH
    java.lang.StringBufferjava.io.ByteArrayOutputStreamVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.StringBuffer of variable line does not match with type java.io.ByteArrayOutputStream of variable buffer
    • Make classes java.lang.StringBuffer and java.io.ByteArrayOutputStream extend a common superclass
    1
    String output = buffer.toString();
                                                                                            
    2
    project.demuxFlush(output, isErrorStream);
    2
    task.log(s, msgOutputLevel);
    2
    task.log(s, msgOutputLevel);
    3
    resetBufferInfo();
    Differences
    Expression1Expression2Difference
    logresetBufferInfoMETHOD_INVOCATION_NAME_MISMATCH
    task.log(s,msgOutputLevel)resetBufferInfo()ARGUMENT_NUMBER_MISMATCH
    taskMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression task.log(s,msgOutputLevel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression task.log(s,msgOutputLevel) is a void method call, and thus it cannot be parameterized
    Expression resetBufferInfo() is a void method call, and thus it cannot be parameterized
    Expression task.log(s,msgOutputLevel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression task.log(s,msgOutputLevel) is a void method call, and thus it cannot be parameterized
    Expression resetBufferInfo() is a void method call, and thus it cannot be parameterized
    3
    resetBufferInfo();
    3
    line = new StringBuffer();
                                                          
    Precondition Violations (8)
    Row Violation
    1Type java.lang.StringBuffer of variable line does not match with type java.io.ByteArrayOutputStream of variable buffer
    2Expression task.log(s,msgOutputLevel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression task.log(s,msgOutputLevel) is a void method call, and thus it cannot be parameterized
    4Expression resetBufferInfo() is a void method call, and thus it cannot be parameterized
    5Expression task.log(s,msgOutputLevel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression task.log(s,msgOutputLevel) is a void method call, and thus it cannot be parameterized
    7Expression resetBufferInfo() is a void method call, and thus it cannot be parameterized
    8Clone fragment #1 returns variables , while Clone fragment #2 returns variables output