if (_session != null) { _session.showErrorMessage(th); } else if (_msgHandler != null) { _msgHandler.showErrorMessage(th, null); } else { s_log.error("No IMessageHandler or ISession configured"); }
if (_session != null) { _session.showErrorMessage(msg); } else if (_msgHandler != null) { _msgHandler.showErrorMessage(msg); } else { s_log.error("No IMessageHandler or ISession configured"); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/DumpSessionCommand.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/DumpSessionCommand.java
Method name: void showErrorMessage(Throwable) Method name: void showErrorMessage(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (_session != null) {
1
if (_session != null) {
2
            _session.showErrorMessage(th);
2
            _session.showErrorMessage(msg);
3
        } else if (_msgHandler != null) {
3
        } else if (_msgHandler != null) {
4
            _msgHandler.showErrorMessage(th, null);
4
            _msgHandler.showErrorMessage(msg);
5
        } else {
5
        } else {
6
            s_log.error("No IMessageHandler or ISession configured");
6
            s_log.error("No IMessageHandler or ISession configured");
7
        }
7
        }
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 declared in the same class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (_session != null)
    1
    if (_session != null)
    2
    _session.showErrorMessage(th);
    2
    _session.showErrorMessage(th);
    2
    _session.showErrorMessage(msg);
    Differences
    Expression1Expression2Difference
    thmsgVARIABLE_NAME_MISMATCH
    java.lang.Throwablejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Throwable of variable th does not match with type java.lang.String of variable msg
    • Make classes java.lang.Throwable and java.lang.String extend a common superclass
    2
    _session.showErrorMessage(msg);
    3
    else if (_msgHandler != null)
    3
    else if (_msgHandler != null)
    4
    _msgHandler.showErrorMessage(th, null);
    4
    _msgHandler.showErrorMessage(th, null);
    4
    _msgHandler.showErrorMessage(msg);
    Differences
    Expression1Expression2Difference
    _msgHandler.showErrorMessage(th,null)_msgHandler.showErrorMessage(msg)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression _msgHandler.showErrorMessage(th,null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _msgHandler.showErrorMessage(msg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _msgHandler.showErrorMessage(th,null) is a void method call, and thus it cannot be parameterized
    Expression _msgHandler.showErrorMessage(msg) is a void method call, and thus it cannot be parameterized
    4
    _msgHandler.showErrorMessage(msg);
    else
    else
    5
    s_log.error("No IMessageHandler or ISession configured");
    5
    s_log.error("No IMessageHandler or ISession configured");
    Precondition Violations (5)
    Row Violation
    1Type java.lang.Throwable of variable th does not match with type java.lang.String of variable msg
    2Expression _msgHandler.showErrorMessage(th,null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression _msgHandler.showErrorMessage(msg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression _msgHandler.showErrorMessage(th,null) is a void method call, and thus it cannot be parameterized
    5Expression _msgHandler.showErrorMessage(msg) is a void method call, and thus it cannot be parameterized