File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/tree/util/SelectAddressbookFolderDialog.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/dialog/DateChooserDialog.java | |||
Method name: void actionPerformed(ActionEvent)
|
Method name: void actionPerformed(ActionEvent)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 7 | |||
1 | String action = e.getActionCommand();↵ | 1 | String action = ev.getActionCommand();↵ | |
2 | if (action.equals("OK")) {↵ | 2 | if (action.equals("OK")) {↵ | |
3 | bool = true;↵ | |||
4 | setVisible(false);↵ | |||
5 | } else if (action.equals("CANCEL")) {↵ | |||
6 | bool = false;↵ | |||
7 | setVisible(false);↵ | |||
8 | } else if (action.equals("NEW")) {↵ | |||
9 | /*↵ | |||
10 | * EditFolderDialog dialog = treeViewer.getEditFolderDialog( "New↵ | |||
11 | * Folder" ); dialog.showDialog(); String name; if (↵ | |||
12 | * dialog.↵ | 3 | success = true;↵ | |
4 | setVisible(false);↵ | |||
5 | } else if (action.equals("CANCEL")) {↵ | |||
13 | success() == true ) { // ok pressed name =↵ | 6 | success↵ | |
14 | * dialog.getName(); } else { // cancel pressed return; }↵ | |||
15 | * treeViewer.getFolderTree().addUserFolder( getSelectedFolder(),↵ | |||
16 | * name ); //TreeNodeEvent updateEvent2 = new TreeNodeEvent(↵ | |||
17 | * getSelectedFolder(), TreeNodeEvent.STRUCTURE_CHANGED );↵ | |||
18 | * //treeViewer.mainInterface.crossbar.fireTreeNodeChanged(updateEvent2);↵ | |||
19 | */↵ | |||
20 | ↵ | 7 | = false;↵ | |
8 | setVisible(false);↵ | |||
21 | } | 9 | } | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 7 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 7 |
Number of unmapped statements in the second code fragment | 6 |
Time elapsed for statement mapping (ms) | 2.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String action = e.getActionCommand(); |
| 1 | String action = ev.getActionCommand(); | ||||||||||
|
| 2 | if (action.equals("OK")) | |||||||||||
|
| 3 | success = true; | |||||||||||
| 4 | setVisible(false); | ||||||||||||
|
| 5 | else if (action.equals("CANCEL")) | |||||||||||
|
| 6 | success = false; | |||||||||||
| 7 | setVisible(false); | ||||||||||||
2 | if (action.equals("OK")) |
| | |||||||||||
3 | bool = true; |
| | |||||||||||
4 | setVisible(false); | | ||||||||||||
5 | else if (action.equals("CANCEL")) |
| | |||||||||||
6 | bool = false; |
| | |||||||||||
7 | setVisible(false); | | ||||||||||||
8 | else if (action.equals("NEW")) |
| |
Row | Violation |
---|---|
1 | Unmatched statement if(action.equals("OK")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement success=true; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement if(action.equals("CANCEL")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement success=false; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched statement if(action.equals("OK")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement bool=true; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched statement if(action.equals("CANCEL")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement bool=false; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
9 | Unmatched statement if(action.equals("NEW")) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |