try { task.run(); } catch (Throwable th) { _callback.showMessage(th); }
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/fw/src/net/sourceforge/squirrel_sql/fw/util/TaskExecuter.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/gui/UpdateManagerDialog.java
Method name: void run() Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 2 Number of AST nodes: 3
1
try
2
				{
3
					task.run();
4
				}
5
				catch (Throwable th)
6
				{
7
					_callback.showMessage(th);
8
				
1
for (CheckUpdateListener listener: _checkUpdateListeners) {
2
               try {
3
                  listener.checkUpToDate();
4
               } catch (Exception ex) {
5
                  listener.showErrorMessage(
6
                     "Unexpected Exception",
7
                     "Update check failed with Exception: " + ex.getMessage(),
8
                     ex);
9
               }
9
}
10
            }
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 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)135.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    try
    13
    try
    3
    try
    Differences
    Expression1Expression2Difference
    java.lang.Throwablejava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    thexVARIABLE_NAME_MISMATCH
    java.lang.Throwablejava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    showMessageshowErrorMessageMETHOD_INVOCATION_NAME_MISMATCH
    _callbacklistenerVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.util.ITaskThreadPoolCallbacknet.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListenerVARIABLE_TYPE_MISMATCH
    _callback.showMessage(th)listener.showErrorMessage("Unexpected Exception","Update check failed with Exception: " + ex.getMessage(),ex)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression _callback.showMessage(th) 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 _callback.showMessage(th) 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.ITaskThreadPoolCallback of variable _callback does not match with type net.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListener of variable listener
    • Make classes net.sourceforge.squirrel_sql.fw.util.ITaskThreadPoolCallback and net.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListener extend a common superclass
    Expression _callback.showMessage(th) 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 _callback.showMessage(th) 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
                                                            
    4
    listener.checkUpToDate();
    Preondition Violations
    Unmatched statement listener.checkUpToDate(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement listener.checkUpToDate(); 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
    4
    listener.checkUpToDate();
    14
    task.run();
    14
    task.run();
    Preondition Violations
    Unmatched statement task.run(); 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
                                  
    Precondition Violations (13)
    Row Violation
    1Expression _callback.showMessage(th) 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 _callback.showMessage(th) 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.ITaskThreadPoolCallback of variable _callback does not match with type net.sourceforge.squirrel_sql.client.update.gui.CheckUpdateListener of variable listener
    6Expression _callback.showMessage(th) 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 _callback.showMessage(th) 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
    10Unmatched statement listener.checkUpToDate(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    11Unmatched statement listener.checkUpToDate(); 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 task.run(); 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
    13The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.fw.util.TaskExecuter and do not have a common superclass