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/addressbook/gui/action/RemoveCardAction.java | |||
Method name: void valueChanged(TreeSelectionEvent)
|
Method name: void valueChanged(TreeSelectionEvent)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | TreePath path = e.getNewLeadSelectionPath();↵ | 1 | TreePath path = e.getNewLeadSelectionPath();↵ | |
2 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();↵ | 2 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner();↵ | |
3 | TreeController tree = ((AddressbookFrameMediator) frameMediator)↵ | 3 | TreeController tree = ((AddressbookFrameMediator) frameMediator)↵ | |
4 | .getTree();↵ | 4 | .getTree();↵ | |
5 | if (tree.equals(focusOwner)) {↵ | 5 | if (tree.equals(focusOwner)) {↵ | |
6 | // tree has focus↵ | 6 | // tree has focus↵ | |
7 | AddressbookTreeNode treeNode = null;↵ | 7 | AddressbookTreeNode treeNode = null;↵ | |
8 | // remember last selected folder treenode↵ | 8 | // remember last selected folder treenode↵ | |
9 | if (path != null) {↵ | 9 | if (path != null) {↵ | |
10 | treeNode = (AddressbookTreeNode) path.getLastPathComponent();↵ | 10 | treeNode = (AddressbookTreeNode) path.getLastPathComponent();↵ | |
11 | }↵ | 11 | }↵ | |
12 | // enable, if more than zero treenodes selected↵ | 12 | // enable, if more than zero treenodes selected↵ | |
13 | if ((path != null) && (treeNode instanceof IGroupFolder)) {↵ | 13 | if ((path != null) && (treeNode instanceof IGroupFolder)) {↵ | |
14 | setEnabled(true);↵ | 14 | setEnabled(true);↵ | |
15 | } else↵ | 15 | } else↵ | |
16 | setEnabled(false);↵ | 16 | setEnabled(false);↵ | |
17 | } else↵ | 17 | } else↵ | |
18 | setEnabled(false); | 18 |
| |
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.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 38 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | TreePath path = e.getNewLeadSelectionPath(); | 1 | TreePath path = e.getNewLeadSelectionPath(); | |
2 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner(); | 2 | FocusOwner focusOwner = FocusManager.getInstance().getCurrentOwner(); | |
3 | TreeController tree = ((AddressbookFrameMediator)frameMediator).getTree(); | 3 | TreeController tree = ((AddressbookFrameMediator)frameMediator).getTree(); | |
4 | if (tree.equals(focusOwner)) | 4 | if (tree.equals(focusOwner)) | |
5 | AddressbookTreeNode treeNode = null; | 5 | AddressbookTreeNode treeNode = null; | |
6 | if (path != null) | 6 | if (path != null) | |
7 | treeNode = (AddressbookTreeNode)path.getLastPathComponent(); | 7 | treeNode = (AddressbookTreeNode)path.getLastPathComponent(); | |
8 | if ((path != null) && (treeNode instanceof IGroupFolder)) | 8 | if ((path != null) && (treeNode instanceof IGroupFolder)) | |
9 | setEnabled(true); | 9 | setEnabled(true); | |
else | else | |||
10 | setEnabled(false); | 10 | setEnabled(false); | |
else | else | |||
11 | setEnabled(false); | 11 | setEnabled(false); |
Row | Violation |
---|