OutputStream os = jcmdProcess.getOutputStream(); os.write(bytes); os.flush();
try { FileOutputStream out= new FileOutputStream( dir+"/"+className+".class" ); out.write(code); out.close(); } catch ( IOException e ) { }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/jeditshell/jcmd/JcmdProcess.java File path: /jEdit-4.2/src/bsh/ClassGeneratorImpl.java
Method name: void sendBreak() Method name: Class generateClassImpl(String, Modifiers, Class[], Class, BSHBlock, boolean, CallStack, Interpreter)
Number of AST nodes: 3 Number of AST nodes: 4
1
try {
1
OutputStream os = jcmdProcess.getOutputStream(
2
			FileOutputStream out= 
2
);
3
				new FileOutputStream( dir+"/"+className+".class" );
3
			os.write(bytes);
4
			out.write(code);
4
			os.flush();
5
			out.close();
6
		} catch ( IOException e ) { }
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
Number of node comparisons5
  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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    OutputStream os = jcmdProcess.getOutputStream();
    4
    OutputStream os = jcmdProcess.getOutputStream();
    21
    FileOutputStream out = new FileOutputStream(dir + "/" + className + ".class");
    Differences
    Expression1Expression2Difference
    java.io.OutputStreamjava.io.FileOutputStreamSUBCLASS_TYPE_MISMATCH
    osoutVARIABLE_NAME_MISMATCH
    java.io.OutputStreamjava.io.FileOutputStreamSUBCLASS_TYPE_MISMATCH
    java.io.OutputStreamjava.io.FileOutputStreamSUBCLASS_TYPE_MISMATCH
    jcmdProcess.getOutputStream()new FileOutputStream(dir + "/" + className+ ".class")TYPE_COMPATIBLE_REPLACEMENT
    21
    FileOutputStream out = new FileOutputStream(dir + "/" + className + ".class");
    5
    os.write(bytes);
    5
    os.write(bytes);
    23
    out.close();
    Differences
    Expression1Expression2Difference
    writecloseMETHOD_INVOCATION_NAME_MISMATCH
    osoutVARIABLE_NAME_MISMATCH
    java.io.OutputStreamjava.io.FileOutputStreamSUBCLASS_TYPE_MISMATCH
    os.write(bytes)out.close()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression os.write(bytes) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression out.close() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression os.write(bytes) is a void method call, and thus it cannot be parameterized
    Expression out.close() is a void method call, and thus it cannot be parameterized
    Expression os.write(bytes) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression out.close() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression os.write(bytes) is a void method call, and thus it cannot be parameterized
    Expression out.close() is a void method call, and thus it cannot be parameterized
    23
    out.close();
    6
    os.flush();
    6
    os.flush();
    22
    out.write(code);
    Differences
    Expression1Expression2Difference
    flushwriteMETHOD_INVOCATION_NAME_MISMATCH
    osoutVARIABLE_NAME_MISMATCH
    java.io.OutputStreamjava.io.FileOutputStreamSUBCLASS_TYPE_MISMATCH
    os.flush()out.write(code)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression os.flush() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression out.write(code) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression os.flush() is a void method call, and thus it cannot be parameterized
    Expression out.write(code) is a void method call, and thus it cannot be parameterized
    Expression os.flush() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression out.write(code) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression os.flush() is a void method call, and thus it cannot be parameterized
    Expression out.write(code) is a void method call, and thus it cannot be parameterized
    22
    out.write(code);
    Precondition Violations (17)
    Row Violation
    1Expression os.write(bytes) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression out.close() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression os.write(bytes) is a void method call, and thus it cannot be parameterized
    4Expression out.close() is a void method call, and thus it cannot be parameterized
    5Expression os.write(bytes) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression out.close() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression os.write(bytes) is a void method call, and thus it cannot be parameterized
    8Expression out.close() is a void method call, and thus it cannot be parameterized
    9Expression os.flush() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression out.write(code) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression os.flush() is a void method call, and thus it cannot be parameterized
    12Expression out.write(code) is a void method call, and thus it cannot be parameterized
    13Expression os.flush() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression out.write(code) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression os.flush() is a void method call, and thus it cannot be parameterized
    16Expression out.write(code) is a void method call, and thus it cannot be parameterized
    17The refactoring of the clones is infeasible, because classes JcmdProcess and bsh.ClassGeneratorImpl do not have a common superclass