if (e.getType() == ErrorEvent.RESTORE_AUTO_COMMIT_TYPE) { String exMsg = ""; if (e.getException() != null) { exMsg = e.getException().getMessage(); } String message = getMessage("CopyProgressMonitor.restoreAutoCommitException", exMsg); String title = getMessage("CopyProgressMonitor.restoreAutoCommitExceptionTitle"); int messageType = JOptionPane.ERROR_MESSAGE; showMessageDialog(message, title, messageType); }
if (e.getType() == ErrorEvent.SETUP_AUTO_COMMIT_TYPE) { String exMsg = ""; if (e.getException() != null) { exMsg = e.getException().getMessage(); } String message = getMessage("CopyProgressMonitor.setupAutoCommitException", exMsg); String title = getMessage("CopyProgressMonitor.setupAutoCommitExceptionTitle"); int messageType = JOptionPane.ERROR_MESSAGE; showMessageDialog(message, title, messageType); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/CopyProgressMonitor.java File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/CopyProgressMonitor.java
Method name: void handleError(ErrorEvent) Method name: void handleError(ErrorEvent)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (e.getType() == ErrorEvent.RESTORE_AUTO_COMMIT_TYPE) {
1
if (e.getType() == ErrorEvent.SETUP_AUTO_COMMIT_TYPE) {
2
            String exMsg = "";
2
            String exMsg = "";
3
            if (e.getException() != null) {
3
            if (e.getException() != null) {
4
                exMsg = e.getException().getMessage();
4
                exMsg = e.getException().getMessage();
5
            }
5
            }            
6
            String message = 
6
            String message = 
7
                getMessage("CopyProgressMonitor.restoreAutoCommitException", 
7
                getMessage("CopyProgressMonitor.setupAutoCommitException",
8
                           exMsg);
8
                           exMsg);
9
            String title =
9
            String title = 
10
                getMessage("CopyProgressMonitor.restoreAutoCommitExceptionTitle");
10
                getMessage("CopyProgressMonitor.setupAutoCommitExceptionTitle");
11
            int messageType = JOptionPane.ERROR_MESSAGE;
11
            int messageType = JOptionPane.ERROR_MESSAGE;
12
            showMessageDialog(message, title, messageType);                                  
12
            showMessageDialog(message, title, messageType);
13
        }
13
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in the same method
Number of node comparisons40
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    if (e.getType() == ErrorEvent.RESTORE_AUTO_COMMIT_TYPE)
    11
    if (e.getType() == ErrorEvent.RESTORE_AUTO_COMMIT_TYPE)
    3
    if (e.getType() == ErrorEvent.SETUP_AUTO_COMMIT_TYPE)
    Differences
    Expression1Expression2Difference
    RESTORE_AUTO_COMMIT_TYPESETUP_AUTO_COMMIT_TYPEVARIABLE_NAME_MISMATCH
    3
    if (e.getType() == ErrorEvent.SETUP_AUTO_COMMIT_TYPE)
    12
    String exMsg = "";
    4
    String exMsg = "";
    13
    if (e.getException() != null)
    5
    if (e.getException() != null)
    14
    exMsg = e.getException().getMessage();
    6
    exMsg = e.getException().getMessage();
    15
    String message = getMessage("CopyProgressMonitor.restoreAutoCommitException", exMsg);
    15
    String message = getMessage("CopyProgressMonitor.restoreAutoCommitException", exMsg);
    7
    String message = getMessage("CopyProgressMonitor.setupAutoCommitException", exMsg);
    Differences
    Expression1Expression2Difference
    "CopyProgressMonitor.restoreAutoCommitException""CopyProgressMonitor.setupAutoCommitException"LITERAL_VALUE_MISMATCH
    7
    String message = getMessage("CopyProgressMonitor.setupAutoCommitException", exMsg);
    16
    String title = getMessage("CopyProgressMonitor.restoreAutoCommitExceptionTitle");
    16
    String title = getMessage("CopyProgressMonitor.restoreAutoCommitExceptionTitle");
    8
    String title = getMessage("CopyProgressMonitor.setupAutoCommitExceptionTitle");
    Differences
    Expression1Expression2Difference
    "CopyProgressMonitor.restoreAutoCommitExceptionTitle""CopyProgressMonitor.setupAutoCommitExceptionTitle"LITERAL_VALUE_MISMATCH
    8
    String title = getMessage("CopyProgressMonitor.setupAutoCommitExceptionTitle");
    17
    int messageType = JOptionPane.ERROR_MESSAGE;
    9
    int messageType = JOptionPane.ERROR_MESSAGE;
    18
    showMessageDialog(message, title, messageType);
    10
    showMessageDialog(message, title, messageType);
    Precondition Violations (0)
    Row Violation