if (dialog.getResult()) { try { // add contact to folder folder.add(dialog.getDestModel()); } catch (Exception e) { if (Logging.DEBUG) e.printStackTrace(); ErrorDialog.createDialog(e.getMessage(), e); } }
try { // modify card properties in folder selectedFolder.modify(selected.getId(), 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/action/AddContactCardAction.java File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/ContactBox.java
Method name: void actionPerformed(ActionEvent) Method name: void openEditContactDialog(IContactModelPartial)
Number of AST nodes: 3 Number of AST nodes: 2
1
if (dialog.getResult()) {
2
				try {
1
try {
3
					// add contact to folder
2
				// 
4
					folder.add(
3
modify card properties in folder
5
dialog.getDestModel());
4
				selectedFolder.modify(selected.getId(), dialog.getDestModel());
6
				} catch (Exception e) {
5
			} catch (Exception e1) {
7
					if (Logging.DEBUG)
6
				if (Logging.DEBUG)
8
						e.printStackTrace();
7
					e1.printStackTrace();
9
					ErrorDialog.createDialog(e.getMessage(), e);
8
				ErrorDialog.createDialog(e1.getMessage(), e1);
10
				}
11
			}
9
			}
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 comparisons5
  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
    6
    try
    6
    try
    10
    try
    Differences
    Expression1Expression2Difference
    ee1VARIABLE_NAME_MISMATCH
    ee1VARIABLE_NAME_MISMATCH
    ee1VARIABLE_NAME_MISMATCH
    ee1VARIABLE_NAME_MISMATCH
    10
    try
    7
    folder.add(dialog.getDestModel());
    7
    folder.add(dialog.getDestModel());
    Preondition Violations
    Unmatched statement folder.add(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
                                                                              
                                                                                                                                        
    11
    selectedFolder.modify(selected.getId(), dialog.getDestModel());
    Preondition Violations
    Unmatched statement selectedFolder.modify(selected.getId(),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
    11
    selectedFolder.modify(selected.getId(), dialog.getDestModel());
    Precondition Violations (2)
    Row Violation
    1Unmatched statement folder.add(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 selectedFolder.modify(selected.getId(),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