File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/dialog/contact/ContactEditorDialog.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/command/OpenAttachmentCommand.java | |||
Method name: void actionPerformed(ActionEvent)
|
Method name: void updateGUI()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | if (action.equals("FORMATTED_NAME_DIALOG")) {↵ | |||
2 | fullNameDialog.setVisible(true);↵ | |||
3 | boolean success = fullNameDialog.getResult();↵ | |||
1 | boolean success = ColumbaDesktop.getInstance().open(tempFile);↵ | |||
2 | // if attachment can't be opened, save it only↵ | |||
4 | if (success) {↵ | 3 | if (!success) {↵ | |
5 | String fn = fullNameDialog.getFormattedName();↵ | 4 | File saveToFile = getDestinationFile(header);↵ | |
6 | // fill formatted textfield↵ | 5 | ↵ | |
7 | formattedNameTextField.setText(fn↵ | 6 | if (saveToFile.exists())↵ | |
8 | );↵ | 7 | saveToFile.delete();↵ | |
9 | fillSortStringComboBox();↵ | 8 | tempFile.renameTo(saveToFile);↵ | |
10 | }↵ | 9 | ↵ | |
11 | } | 10 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 17 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 2.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 21 | boolean success = ColumbaDesktop.getInstance().open(tempFile); | ||||||||||||||
9 | if (action.equals("FORMATTED_NAME_DIALOG")) |
| 22 | if (!success) | ||||||||||||
10 | fullNameDialog.setVisible(true); | | ||||||||||||||
11 | boolean success = fullNameDialog.getResult(); | | ||||||||||||||
|
| 23 | File saveToFile = getDestinationFile(header); | |||||||||||||
12 | if (success) |
| 24 | if (saveToFile.exists()) | ||||||||||||
13 | String fn = fullNameDialog.getFormattedName(); | | ||||||||||||||
14 | formattedNameTextField.setText(fn); | | ||||||||||||||
15 | fillSortStringComboBox(); |
| | |||||||||||||
|
| 25 | saveToFile.delete(); | |||||||||||||
|
| 26 | tempFile.renameTo(saveToFile); |
Row | Violation |
---|---|
1 | Expression !success cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement File saveToFile=getDestinationFile(header); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Expression success cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression saveToFile.exists() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement fillSortStringComboBox(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement saveToFile.delete(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement tempFile.renameTo(saveToFile); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | The refactoring of the clones is infeasible, because classes org.columba.addressbook.gui.dialog.contact.ContactEditorDialog and org.columba.mail.gui.message.command.OpenAttachmentCommand do not have a common superclass |