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);
}
try {
card = (IContactModel) selectedFolder.get(selected.getId());
} catch (Exception e) {
if (Logging.DEBUG)
e.printStackTrace();
ErrorDialog.createDialog(e.getMessage(), e);
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/action/EditPropertiesAction.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: 2
|
|
Number of AST nodes: 2
|
|
1 | try {↵ | | 1 | try {↵
|
2 | // modify card properties in folder↵ | | 2 | ↵
|
3 | folder.modify(uids[0], dialog.getDestModel());↵ | | 3 | card = (IContactModel) selectedFolder.get(selected.getId());↵
|
4 | } catch (Exception e1) {↵ | | 4 | } catch (Exception e) {↵
|
5 | if (Logging.DEBUG)↵ | | 5 | if (Logging.DEBUG)↵
|
6 | e1.printStackTrace();↵ | | 6 | e.printStackTrace();↵
|
|
7 | ErrorDialog.createDialog(e1.getMessage(), e1);↵ | | 7 | ErrorDialog.createDialog(e.getMessage(), e);↵
|
8 | } | | 8 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 4 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
17 | try | | 2 | try |
| | | 3 | card = (IContactModel)selectedFolder.get(selected.getId()); |
18 | folder.modify(uids[0], dialog.getDestModel()); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement card=(IContactModel)selectedFolder.get(selected.getId()); 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 |
2 | 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 |