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); }
for (CheckUpdateListener listener: _checkUpdateListeners) { try { listener.checkUpToDate(); } catch (Exception ex) { listener.showErrorMessage( "Unexpected Exception", "Update check failed with Exception: " + ex.getMessage(), ex); } }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/BaseListInternalFrame.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/gui/UpdateManagerDialog.java
Method name: void onMouseClicked(MouseEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 2 Number of AST nodes: 3
1
try
1
for (CheckUpdateListener listener: _checkUpdateListeners) {
2
            {
2
               try {
3
               cmd.execute();
3
                  listener.checkUpToDate();
4
            }
4
            
5
            catch (BaseException ex)
5
   } catch (Exception ex) {
6
            {
6
            
7
                      // i18n[BaseListInternalFrame.error.
7
      listener.showErrorMessage(
8
execdoubleclick=Error occured executing doubleclick event]
8
                     "Unexpec
9
               s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"), ex);
9
ted Exception",
10
                     "Update check failed with Exception: " + ex.getMessage(),
11
                     ex);
12
               }
10
            }
13
            }
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 comparisons5
  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)7166.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    try
    4
    try
    3
    try
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.fw.util.BaseExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.fw.util.BaseExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    errorshowErrorMessageMETHOD_INVOCATION_NAME_MISMATCH
    s_loglistenerVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.util.log.ILoggernet.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListenerVARIABLE_TYPE_MISMATCH
    s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex)listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    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 listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex) 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) is a void method call, and thus it cannot be parameterized
    Expression listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex) is a void method call, and thus it cannot be parameterized
    Type net.sourceforge.squirrel_sql.fw.util.log.ILogger of variable s_log does not match with type net.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListener of variable listener
    • Make classes net.sourceforge.squirrel_sql.fw.util.log.ILogger and net.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListener extend a common superclass
    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 listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex) 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) is a void method call, and thus it cannot be parameterized
    Expression listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex) is a void method call, and thus it cannot be parameterized
    3
    try
    5
    cmd.execute();
    5
    cmd.execute();
    4
    listener.checkUpToDate();
    Differences
    Expression1Expression2Difference
    executecheckUpToDateMETHOD_INVOCATION_NAME_MISMATCH
    cmdlistenerVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.util.ICommandnet.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression cmd.execute() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression listener.checkUpToDate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression cmd.execute() is a void method call, and thus it cannot be parameterized
    Expression listener.checkUpToDate() is a void method call, and thus it cannot be parameterized
    Type net.sourceforge.squirrel_sql.fw.util.ICommand of variable cmd does not match with type net.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListener of variable listener
    • Make classes net.sourceforge.squirrel_sql.fw.util.ICommand and net.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListener extend a common superclass
    4
    listener.checkUpToDate();
    Precondition Violations (15)
    Row Violation
    1Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) is a void method call, and thus it cannot be parameterized
    4Expression listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex) is a void method call, and thus it cannot be parameterized
    5Type net.sourceforge.squirrel_sql.fw.util.log.ILogger of variable s_log does not match with type net.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListener of variable listener
    6Expression s_log.error(s_stringMgr.getString("BaseListInternalFrame.error.execdoubleclick"),ex) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex) 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) is a void method call, and thus it cannot be parameterized
    9Expression listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex) is a void method call, and thus it cannot be parameterized
    10Expression cmd.execute() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression listener.checkUpToDate() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression cmd.execute() is a void method call, and thus it cannot be parameterized
    13Expression listener.checkUpToDate() is a void method call, and thus it cannot be parameterized
    14Type net.sourceforge.squirrel_sql.fw.util.ICommand of variable cmd does not match with type net.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListener of variable listener
    15The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.gui.db.BaseListInternalFrame and do not have a common superclass