try { jdbcContext.connection().rollback(); } finally { toggleAutoCommit(); }
try { jdbcContext.connection().commit(); } finally { toggleAutoCommit(); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transaction/JDBCTransaction.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/transaction/JDBCTransaction.java
Method name: void rollbackAndResetAutoCommit() Method name: void commitAndResetAutoCommit()
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
			jdbcContext.connection().rollback();
2
			jdbcContext.connection().commit();
3
		}
3
		}
4
		finally {
4
		finally {
5
			toggleAutoCommit();
5
			toggleAutoCommit();
6
		}
6
		}
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.1
Clones locationClones are declared in the same class
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)0.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    2
    jdbcContext.connection().rollback();
    2
    jdbcContext.connection().rollback();
    2
    jdbcContext.connection().commit();
    Differences
    Expression1Expression2Difference
    rollbackcommitMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression jdbcContext.connection().rollback() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression jdbcContext.connection().commit() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression jdbcContext.connection().rollback() is a void method call, and thus it cannot be parameterized
    Expression jdbcContext.connection().commit() is a void method call, and thus it cannot be parameterized
    2
    jdbcContext.connection().commit();
    Precondition Violations (4)
    Row Violation
    1Expression jdbcContext.connection().rollback() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression jdbcContext.connection().commit() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression jdbcContext.connection().rollback() is a void method call, and thus it cannot be parameterized
    4Expression jdbcContext.connection().commit() is a void method call, and thus it cannot be parameterized