if (initialized) { inputStream.close(); }
if (showErrorMessages) { System.out.println( "MockMessageHandler.showErrorMessage(String): msg="+msg); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dataimport/src/com/csvreader/CsvReader.java File path: /sql12/test/mockobjects/net/sourceforge/squirrel_sql/fw/util/MockMessageHandler.java
Method name: void close(boolean) Method name: void showErrorMessage(String)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (initialized) {
1
if (
2
					inputStream.close();
3
			
2
showErrorMessages) {
3
    		System.out.println(
4
    			"MockMessageHandler.showErrorMessage(String): msg="+msg);
4
	}
5
    	}
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 comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    if (initialized)
    10
    if (initialized)
    1
    if (showErrorMessages)
    Differences
    Expression1Expression2Difference
    initializedshowErrorMessagesVARIABLE_NAME_MISMATCH
    1
    if (showErrorMessages)
    11
    inputStream.close();
    11
    inputStream.close();
    2
    System.out.println("MockMessageHandler.showErrorMessage(String): msg=" + msg);
    Differences
    Expression1Expression2Difference
    closeprintlnMETHOD_INVOCATION_NAME_MISMATCH
    java.io.Readerjava.io.PrintStreamSUBCLASS_TYPE_MISMATCH
    inputStreamSystem.outTYPE_COMPATIBLE_REPLACEMENT
    inputStream.close()System.out.println("MockMessageHandler.showErrorMessage(String): msg=" + msg)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression inputStream.close() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression inputStream.close() is a void method call, and thus it cannot be parameterized
    Expression System.out.println("MockMessageHandler.showErrorMessage(String): msg=" + msg) is a void method call, and thus it cannot be parameterized
    Expression inputStream cannot be unified with expression System.out , because common superclass java.io.Closeable does not declare member(s) public void println(java.lang.String)
    Expression inputStream.close() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression inputStream.close() is a void method call, and thus it cannot be parameterized
    Expression System.out.println("MockMessageHandler.showErrorMessage(String): msg=" + msg) is a void method call, and thus it cannot be parameterized
    2
    System.out.println("MockMessageHandler.showErrorMessage(String): msg=" + msg);
    Precondition Violations (7)
    Row Violation
    1Expression inputStream.close() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression inputStream.close() is a void method call, and thus it cannot be parameterized
    3Expression System.out.println("MockMessageHandler.showErrorMessage(String): msg=" + msg) is a void method call, and thus it cannot be parameterized
    4Expression inputStream cannot be unified with expression System.out , because common superclass java.io.Closeable does not declare member(s) public void println(java.lang.String)
    5Expression inputStream.close() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    6Expression inputStream.close() is a void method call, and thus it cannot be parameterized
    7Expression System.out.println("MockMessageHandler.showErrorMessage(String): msg=" + msg) is a void method call, and thus it cannot be parameterized