try { message = formatter.format(th); } catch (Exception e) { s_log.error("Unable to format message: "+e.getMessage(), e); }
if (customFormatter != null && customFormatter.formatsException(cause)) { try { customMessage = customFormatter.format(cause); } catch (Exception e) { s_log.error( "Exception occurred while formatting: "+e.getMessage(), e); } }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/MessagePanel.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/DefaultExceptionFormatter.java
Method name: void privateShowMessage(Throwable, ExceptionFormatter, SimpleAttributeSet) Method name: String format(Throwable)
Number of AST nodes: 2 Number of AST nodes: 3
1
try {
2
                  m
1
if (customFormatter != null && customFormatter.formatsException(cause)) {
2
            try {
3
essage = formatter.format(th);
3
                customMessage = customFormatter.format(cause);
4
              } catch (Exception e) {
4
            } catch (Exception e) {
5
                  s_log.error("Unable to format message:
5
                s_log.error( 
6
 "+e.getMessage(), e);
6
                    "Exception occurred while formatting:  "+e.getMessage(), e);
7
      
7
            }
8
        }
8
        }
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.2
Clones locationClones are in different classes
Number of node comparisons4
  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)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    try
    5
    try
    11
    try
    Differences
    Expression1Expression2Difference
    "Unable to format message: ""Exception occurred while formatting: "LITERAL_VALUE_MISMATCH
    11
    try
    6
    message = formatter.format(th);
    6
    message = formatter.format(th);
    12
    customMessage = customFormatter.format(cause);
    Differences
    Expression1Expression2Difference
    messagecustomMessageVARIABLE_NAME_MISMATCH
    thcauseVARIABLE_NAME_MISMATCH
    formattercustomFormatterVARIABLE_NAME_MISMATCH
    12
    customMessage = customFormatter.format(cause);
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.MessagePanel and net.sourceforge.squirrel_sql.fw.util.DefaultExceptionFormatter do not have a common superclass