try {
FrameManager.getInstance().openView("ThreePaneMail");
} catch (PluginLoadingFailedException e) {
e.printStackTrace();
}
if (child instanceof AddressbookFolder) {
try {
((AddressbookFolder) child).save();
} catch (Exception ex) {
ex.printStackTrace();
}
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/globalactions/OpenNewMailWindowAction.java
|
|
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/shutdown/SaveAllAddressbooksPlugin.java
|
Method name: void actionPerformed(ActionEvent)
|
|
Method name: void saveFolders(AddressbookTreeNode)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 3
|
|
1 | try {↵ | | |
|
2 | FrameManager.getInstance().openView("ThreePaneMail");↵ | | |
|
3 | } catch (PluginLoadingFailed↵ | | 1 | if (child instanceof AddressbookFolder) {↵
|
| | | 2 | try {↵
|
| | | 3 | ((AddressbookFolder) child).save();↵
|
4 | Exception e) {↵ | | 4 | } catch (Exception ex) {↵
|
5 | e.printStackTrace();↵ | | |
|
6 | ↵ | | 5 | ex.printStackTrace();↵
|
| | | 6 | }↵
|
7 | } | | 7 | }
|
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.2 |
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) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | try | | 4 | try |
2 | FrameManager.getInstance().openView("ThreePaneMail"); | | | |
| | | 5 | ((AddressbookFolder)child).save(); |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement FrameManager.getInstance().openView("ThreePaneMail"); 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 ((AddressbookFolder)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 |
3 | The refactoring of the clones is infeasible, because classes org.columba.core.gui.globalactions.OpenNewMailWindowAction and org.columba.addressbook.shutdown.SaveAllAddressbooksPlugin do not have a common superclass |