try { Thread.sleep(ms); } catch (InterruptedException e) { log.warn("Interrupted during sleep", e); }
if ( rootSession == null && tx != null ) { try { interceptor.afterTransactionCompletion(tx); } catch (Throwable t) { log.error("exception in interceptor afterTransactionCompletion()", t); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/functional/CacheTestCaseBase.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionImpl.java
Method name: void sleep(long) Method name: void afterTransactionCompletion(boolean, Transaction)
Number of AST nodes: 2 Number of AST nodes: 3
1
try {
2
            Thread.sleep(ms);
3
        }
4
        catch (InterruptedException e) {
5
            log.warn("Interrupted during sleep
1
if ( rootSession == null && tx != null ) {
2
			try {
3
				interceptor.afterTransactionCompletion(tx);
4
			}
5
			catch (Throwable t) {
6
", e);
6
				log.error("exception in interceptor afterTransactionCompletion()", t);
7
        
7
			}
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.2
Clones locationClones are in different classes
Number of node comparisons4
  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)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    5
    try
    Differences
    Expression1Expression2Difference
    java.lang.InterruptedExceptionjava.lang.ThrowableSUBCLASS_TYPE_MISMATCH
    etVARIABLE_NAME_MISMATCH
    java.lang.InterruptedExceptionjava.lang.ThrowableSUBCLASS_TYPE_MISMATCH
    warnerrorMETHOD_INVOCATION_NAME_MISMATCH
    "Interrupted during sleep""exception in interceptor afterTransactionCompletion()"LITERAL_VALUE_MISMATCH
    etVARIABLE_NAME_MISMATCH
    java.lang.InterruptedExceptionjava.lang.ThrowableSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression log.warn("Interrupted during sleep",e) is a void method call, and thus it cannot be parameterized
    Expression log.error("exception in interceptor afterTransactionCompletion()",t) is a void method call, and thus it cannot be parameterized
    5
    try
    2
    Thread.sleep(ms);
    2
    Thread.sleep(ms);
    Preondition Violations
    Unmatched statement Thread.sleep(ms); 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
                                            
                                                                                                
    6
    interceptor.afterTransactionCompletion(tx);
    Precondition Violations (3)
    Row Violation
    1Expression log.warn("Interrupted during sleep",e) is a void method call, and thus it cannot be parameterized
    2Expression log.error("exception in interceptor afterTransactionCompletion()",t) is a void method call, and thus it cannot be parameterized
    3Unmatched statement Thread.sleep(ms); 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