try { persistence.save(); } catch (Exception e) { e.printStackTrace(); }
if (child instanceof AddressbookFolder) { try { child.save(); } catch (Exception ex) { ex.printStackTrace(); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/config/Config.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/main/AddressbookExitWorker.java
Method name: void run() Method name: void saveAddressbookFolder(AbstractFolder)
Number of AST nodes: 2 Number of AST nodes: 3
1
try {
2
					persistence.save();
3
				
1
if (child instanceof AddressbookFolder) {
2
                    try {
3
                        child.save();
4
} catch (Exception e) {
4
                    } catch (Exception ex) {
5
					e.printStackTrace();
6
				
5
                        ex.printStackTrace();
6
                    }
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.2
Clones locationClones are in different classes
Number of node comparisons4
  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)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    6
    try
    Differences
    Expression1Expression2Difference
    eexVARIABLE_NAME_MISMATCH
    eexVARIABLE_NAME_MISMATCH
    6
    try
    2
    persistence.save();
    2
    persistence.save();
    Preondition Violations
    Unmatched statement persistence.save(); 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
                                                
                                    
    7
    child.save();
    Preondition Violations
    Unmatched statement child.save(); 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
    7
    child.save();
    Precondition Violations (3)
    Row Violation
    1Unmatched statement persistence.save(); 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
    2Unmatched statement child.save(); 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
    3The refactoring of the clones is infeasible, because classes and org.columba.addressbook.main.AddressbookExitWorker do not have a common superclass