File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/shutdown/SaveAllAddressbooksPlugin.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/desktop/JDICDesktop.java | |||
Method name: void saveFolders(AddressbookTreeNode)
|
Method name: void browse(URL)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 2 | |||
1 | if (child instanceof AddressbookFolder) {↵ | |||
2 | try {↵ | |||
3 | ((AddressbookFolder) child).save();↵ | |||
4 | ↵ | 1 | try {↵ | |
2 | Desktop.browse(url);↵ | |||
5 | } catch (Exception ex) {↵ | 3 | } catch (DesktopException e) {↵ | |
6 | ex.printStackT↵ | 4 | JOptionPane.showMessageDialog(FrameManager.getInstance()↵ | |
7 | race();↵ | 5 | .getActiveFrame()↵ | |
8 | }↵ | |||
9 | ↵ | 6 | , GlobalResourceLoader.getString(↵ | |
7 | "org.columba.core.i18n.dialog", "error", "no_browser"),↵ | |||
8 | "Error", JOptionPane.ERROR_MESSAGE);↵ | |||
10 | } | 9 | } | |
See real code fragment | See real code fragment |
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 |
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) | 20.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | try |
| 1 | try | ||||||||||||||||||||||||||||||||||||
|
| 2 | Desktop.browse(url); | |||||||||||||||||||||||||||||||||||||
5 | ((AddressbookFolder)child).save(); |
| |
Row | Violation |
---|---|
1 | Expression ex.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression ex.printStackTrace() is a void method call, and thus it cannot be parameterized |
3 | Expression JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_browser"),"Error",JOptionPane.ERROR_MESSAGE) is a void method call, and thus it cannot be parameterized |
4 | Expression ex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type java.lang.Exception of variable ex does not match with type javax.swing.JOptionPane of variable JOptionPane |
6 | Expression ex.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression ex.printStackTrace() is a void method call, and thus it cannot be parameterized |
8 | Expression JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_browser"),"Error",JOptionPane.ERROR_MESSAGE) is a void method call, and thus it cannot be parameterized |
9 | Unmatched statement Desktop.browse(url); 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 |
10 | 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 |
11 | The refactoring of the clones is infeasible, because classes org.columba.addressbook.shutdown.SaveAllAddressbooksPlugin and org.columba.core.desktop.JDICDesktop do not have a common superclass |