try { getSQLConnection().commit(); final String msg = s_stringMgr.getString("Session.commit"); _msgHandler.showMessage(msg); } catch (Throwable ex) { _msgHandler.showErrorMessage(ex, formatter); }
try { getSQLConnection().rollback(); final String msg = s_stringMgr.getString("Session.rollback"); _msgHandler.showMessage(msg); } catch (Exception ex) { _msgHandler.showErrorMessage(ex, formatter); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/Session.java
Method name: void commit() Method name: void rollback()
Number of AST nodes: 4 Number of AST nodes: 4
1
try
1
try
2
      {
2
      {
3
         getSQLConnection().commit();
3
         getSQLConnection().rollback();
4
         final String msg = s_stringMgr.getString("Session.commit");
4
         final String msg = s_stringMgr.getString("Session.rollback");
5
         _msgHandler.showMessage(msg);
5
         _msgHandler.showMessage(msg);
6
      }
6
      }
7
      catch (Throwable ex)
7
      catch (Exception ex)
8
      {
8
      {
9
         _msgHandler.showErrorMessage(ex, formatter);
9
         _msgHandler.showErrorMessage(ex, formatter);
10
      }
10
      }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    java.lang.Throwablejava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.Throwablejava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.Throwablejava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    1
    try
    2
    getSQLConnection().commit();
    2
    getSQLConnection().commit();
    2
    getSQLConnection().rollback();
    Differences
    Expression1Expression2Difference
    commitrollbackMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getSQLConnection().commit() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression getSQLConnection().rollback() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression getSQLConnection().commit() is a void method call, and thus it cannot be parameterized
    Expression getSQLConnection().rollback() is a void method call, and thus it cannot be parameterized
    2
    getSQLConnection().rollback();
    3
    final String msg = s_stringMgr.getString("Session.commit");
    3
    final String msg = s_stringMgr.getString("Session.commit");
    3
    final String msg = s_stringMgr.getString("Session.rollback");
    Differences
    Expression1Expression2Difference
    "Session.commit""Session.rollback"LITERAL_VALUE_MISMATCH
    3
    final String msg = s_stringMgr.getString("Session.rollback");
    4
    _msgHandler.showMessage(msg);
    4
    _msgHandler.showMessage(msg);
    Precondition Violations (4)
    Row Violation
    1Expression getSQLConnection().commit() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression getSQLConnection().rollback() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression getSQLConnection().commit() is a void method call, and thus it cannot be parameterized
    4Expression getSQLConnection().rollback() is a void method call, and thus it cannot be parameterized