if (os != null) { try { os.close(); } catch (Exception e) { s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(), e); } }
try { task.run(); } catch (Throwable th) { _callback.showMessage(th); }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/IOUtilitiesImpl.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/TaskExecuter.java
Method name: void closeOutputStream(OutputStream) Method name: void run()
Number of AST nodes: 3 Number of AST nodes: 2
1
if (os != null)
2
		{
3
			try
1
try
4
			{
2
				{
5
				os.close();
3
					task.run();
6
			}
4
				}
7
			catch (Exception e)
5
				catch (Throwable th)
8
			{
6
				{
9
				s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(), e);
7
					_callback.showMessage(th);
10
			}
8
			
11
		}
9
	}
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.3
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)15.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    13
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionjava.lang.ThrowableSUBCLASS_TYPE_MISMATCH
    ethVARIABLE_NAME_MISMATCH
    java.lang.Exceptionjava.lang.ThrowableSUBCLASS_TYPE_MISMATCH
    errorshowMessageMETHOD_INVOCATION_NAME_MISMATCH
    s_log_callbackVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.util.log.ILoggernet.sourceforge.squirrel_sql.fw.util.ITaskThreadPoolCallbackVARIABLE_TYPE_MISMATCH
    s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(),e)_callback.showMessage(th)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(),e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _callback.showMessage(th) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(),e) is a void method call, and thus it cannot be parameterized
    Expression _callback.showMessage(th) is a void method call, and thus it cannot be parameterized
    Type net.sourceforge.squirrel_sql.fw.util.log.ILogger of variable s_log does not match with type net.sourceforge.squirrel_sql.fw.util.ITaskThreadPoolCallback of variable _callback
    • Make classes net.sourceforge.squirrel_sql.fw.util.log.ILogger and net.sourceforge.squirrel_sql.fw.util.ITaskThreadPoolCallback extend a common superclass
    Expression s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(),e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _callback.showMessage(th) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(),e) is a void method call, and thus it cannot be parameterized
    Expression _callback.showMessage(th) is a void method call, and thus it cannot be parameterized
    13
    try
    3
    os.close();
    3
    os.close();
    Preondition Violations
    Unmatched statement os.close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                
                                  
    14
    task.run();
    Preondition Violations
    Unmatched statement task.run(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    14
    task.run();
    Precondition Violations (12)
    Row Violation
    1Expression s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(),e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression _callback.showMessage(th) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(),e) is a void method call, and thus it cannot be parameterized
    4Expression _callback.showMessage(th) is a void method call, and thus it cannot be parameterized
    5Type net.sourceforge.squirrel_sql.fw.util.log.ILogger of variable s_log does not match with type net.sourceforge.squirrel_sql.fw.util.ITaskThreadPoolCallback of variable _callback
    6Expression s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(),e) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression _callback.showMessage(th) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression s_log.error("closeOutpuStream: Unable to close OutputStream - " + e.getMessage(),e) is a void method call, and thus it cannot be parameterized
    9Expression _callback.showMessage(th) is a void method call, and thus it cannot be parameterized
    10Unmatched statement os.close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    11Unmatched statement task.run(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    12The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.fw.util.IOUtilitiesImpl and net.sourceforge.squirrel_sql.fw.util.TaskExecuter do not have a common superclass