try { waitForAllLock.wait(); } catch(InterruptedException ie) { Log.log(Log.ERROR,this,ie); }
try { stream.flush(); } catch(IOException io) { io.printStackTrace(realErr); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/util/WorkThreadPool.java File path: /jEdit-4.2/src/org/gjt/sp/util/Log.java
Method name: void waitForRequests() Method name: void flushStream()
Number of AST nodes: 2 Number of AST nodes: 2
1
try
1
try
2
				{
2
			{
3
					waitForAllLock.wait();
3
				stream.flush();
4
				}
4
			}
5
				catch(InterruptedException ie)
5
			catch(IOException io)
6
				{
6
			{
7
					Log.log(Log.ERROR,this,ie);
7
				io.printStackTrace(realErr);
8
				}
8
			}
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.9
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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    try
    5
    try
    2
    try
    Differences
    Expression1Expression2Difference
    java.lang.InterruptedExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    ieioVARIABLE_NAME_MISMATCH
    java.lang.InterruptedExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    logprintStackTraceMETHOD_INVOCATION_NAME_MISMATCH
    org.gjt.sp.util.Logjava.io.IOExceptionVARIABLE_TYPE_MISMATCH
    Log.log(Log.ERROR,this,ie)io.printStackTrace(realErr)TYPE_COMPATIBLE_REPLACEMENT
    Log.log(Log.ERROR,this,ie)io.printStackTrace(realErr)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression Log.log(Log.ERROR,this,ie) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression io.printStackTrace(realErr) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Log.log(Log.ERROR,this,ie) is a void method call, and thus it cannot be parameterized
    Expression io.printStackTrace(realErr) is a void method call, and thus it cannot be parameterized
    Expression io cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.gjt.sp.util.Log of variable Log does not match with type java.io.IOException of variable io
    • Make classes org.gjt.sp.util.Log and java.io.IOException extend a common superclass
    Expression Log.log(Log.ERROR,this,ie) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression io.printStackTrace(realErr) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Log.log(Log.ERROR,this,ie) is a void method call, and thus it cannot be parameterized
    Expression io.printStackTrace(realErr) is a void method call, and thus it cannot be parameterized
    2
    try
                                        
    3
    stream.flush();
    Preondition Violations
    Unmatched statement stream.flush(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement stream.flush(); 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
    3
    stream.flush();
    6
    waitForAllLock.wait();
    6
    waitForAllLock.wait();
    Preondition Violations
    Unmatched statement waitForAllLock.wait(); 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
                                                      
    Precondition Violations (13)
    Row Violation
    1Expression Log.log(Log.ERROR,this,ie) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression io.printStackTrace(realErr) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression Log.log(Log.ERROR,this,ie) is a void method call, and thus it cannot be parameterized
    4Expression io.printStackTrace(realErr) is a void method call, and thus it cannot be parameterized
    5Expression io cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type org.gjt.sp.util.Log of variable Log does not match with type java.io.IOException of variable io
    7Expression Log.log(Log.ERROR,this,ie) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression io.printStackTrace(realErr) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression Log.log(Log.ERROR,this,ie) is a void method call, and thus it cannot be parameterized
    10Expression io.printStackTrace(realErr) is a void method call, and thus it cannot be parameterized
    11Unmatched statement stream.flush(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    12Unmatched statement stream.flush(); 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
    13Unmatched statement waitForAllLock.wait(); 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