try { con.commit(); } catch (Exception e) { e.printStackTrace(); }
try { cmd.execute(); } catch (BaseException ex) { // i18n[BaseListInternalFrame.error.execdoubleclick=Error occured executing doubleclick event] s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"), ex); }
Clone fragments detected by clone detection tool
File path: /sql12/test/mockobjects/net/sourceforge/squirrel_sql/client/session/MockSession.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/BaseListInternalFrame.java
Method name: void commit() Method name: void onMouseClicked(MouseEvent)
Number of AST nodes: 2 Number of AST nodes: 2
1
try
1
try
2
 {
2
            {
3
            con.commit();
3
            
4
        }
4
   cmd.execute();
5
            }
5
 catch (Exception e) {
6
            catch (BaseException e
6
            e.printStackTrace();
7
x)
8
            {
9
                      // i18n[BaseListInternalFrame.error.execdoubleclick=Error occured executing doubleclick event]
10
               s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"), ex);
7
        }
11
            }
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 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)9.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    4
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionnet.sourceforge.squirrel_sql.fw.util.BaseExceptionSUBCLASS_TYPE_MISMATCH
    eexVARIABLE_NAME_MISMATCH
    java.lang.Exceptionnet.sourceforge.squirrel_sql.fw.util.BaseExceptionSUBCLASS_TYPE_MISMATCH
    printStackTraceerrorMETHOD_INVOCATION_NAME_MISMATCH
    es_logVARIABLE_NAME_MISMATCH
    java.lang.Exceptionnet.sourceforge.squirrel_sql.fw.util.log.ILoggerVARIABLE_TYPE_MISMATCH
    e.printStackTrace()s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) is a void method call, and thus it cannot be parameterized
    Expression e cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Exception of variable e does not match with type net.sourceforge.squirrel_sql.fw.util.log.ILogger of variable s_log
    • Make classes java.lang.Exception and net.sourceforge.squirrel_sql.fw.util.log.ILogger extend a common superclass
    Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) is a void method call, and thus it cannot be parameterized
    4
    try
    2
    con.commit();
    2
    con.commit();
    Preondition Violations
    Unmatched statement con.commit(); 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
                                    
                                      
    5
    cmd.execute();
    Preondition Violations
    Unmatched statement cmd.execute(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement cmd.execute(); 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
    5
    cmd.execute();
    Precondition Violations (14)
    Row Violation
    1Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    4Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) is a void method call, and thus it cannot be parameterized
    5Expression e cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.lang.Exception of variable e does not match with type net.sourceforge.squirrel_sql.fw.util.log.ILogger of variable s_log
    7Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    10Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) is a void method call, and thus it cannot be parameterized
    11Unmatched statement con.commit(); 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
    12Unmatched statement cmd.execute(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    13Unmatched statement cmd.execute(); 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
    14The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.MockSession and net.sourceforge.squirrel_sql.client.gui.db.BaseListInternalFrame do not have a common superclass