try { // modify card properties in folder folder.modify(uids[0], dialog.getDestModel()); } catch (Exception e1) { if (Logging.DEBUG) e1.printStackTrace(); ErrorDialog.createDialog(e1.getMessage(), e1); } if (folder instanceof GroupFolder) // re-select folder mediator.getTree().setSelectedFolder((AbstractFolder) folder);
if (dialog.getResult()) { try { // modify card properties in folder folder.modify(contactId, dialog.getDestModel()); } catch (Exception e1) { if (Logging.DEBUG) e1.printStackTrace(); ErrorDialog.createDialog(e1.getMessage(), e1); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/table/TableMouseListener.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/facade/DialogFacade.java
Method name: void doubleClick(MouseEvent) Method name: void openContactDialog(URI)
Number of AST nodes: 4 Number of AST nodes: 3
1
try
2
        {
3
          
1
if (dialog.getResult()) {
2
			try {
4
// modify card properties in folder
3
				// modify card properties in folder
5
          folder.modify(uids[0], dialog.getDestModel());
4
				folder.modify(contactId, dialog.getDestModel());
6
        }
7
        catch (Exception e1)
5
			} catch (Exception e1)
8
        {
9
          
6
 {
10
if (Logging.DEBUG)
7
				if (Logging.DEBUG)
11
            e1.printStackTrace();
8
					e1.printStackTrace();
12
          ErrorDialog.createDialog(e1.getMessage(), e1);
9
				ErrorDialog.createDialog(e1.getMessage(), e1);
13
        }
14
        if (folder instanceof GroupFolder)
15
          //					 re-select folder
16
          mediator.getTree().setSelectedFolder((AbstractFolder) folder);
10
			}
11
		}
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 comparisons6
  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.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    try
    15
    try
    12
    folder.modify(uids[0], dialog.getDestModel());
    12
    folder.modify(uids[0], dialog.getDestModel());
    Preondition Violations
    Unmatched statement folder.modify(uids[0],dialog.getDestModel()); 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
                                                                                                      
                                                                                                          
    16
    folder.modify(contactId, dialog.getDestModel());
    Preondition Violations
    Unmatched statement folder.modify(contactId,dialog.getDestModel()); 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
    16
    folder.modify(contactId, dialog.getDestModel());
    Precondition Violations (2)
    Row Violation
    1Unmatched statement folder.modify(uids[0],dialog.getDestModel()); 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 folder.modify(contactId,dialog.getDestModel()); 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