File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/session/SessionPanel.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/session/ObjectTreeInternalFrame.java | |||
Method name: void valueChanged(TreeSelectionEvent)
|
Method name: void valueChanged(TreeSelectionEvent)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 8 | |||
1 | final TreePath selPath = evt.getNewLeadSelectionPath();↵ | 1 | final TreePath selPath = evt.getNewLeadSelectionPath();↵ | |
2 | if (selPath != null)↵ | 2 | if (selPath != null)↵ | |
3 | {↵ | |||
4 | ↵ | 3 | {↵ | |
5 | StringBuffer buf = new StringBuffer();↵ | 4 | StringBuffer buf = new StringBuffer();↵ | |
6 | Object[] fullPath = selPath.getPath();↵ | 5 | Object[] fullPath = selPath.getPath();↵ | |
7 | for (int i = 0; i < fullPath.length; ++i)↵ | 6 | for (int i = 0; i < fullPath.length; ++i)↵ | |
8 | {↵ | |||
9 | ↵ | 7 | {↵ | |
10 | if (fullPath[i] instanceof ObjectTreeNode)↵ | 8 | if (fullPath[i] instanceof ObjectTreeNode)↵ | |
11 | {↵ | |||
12 | ↵ | 9 | {↵ | |
13 | ObjectTreeNode node = (ObjectTreeNode)fullPath[i];↵ | 10 | ObjectTreeNode node = (ObjectTreeNode)fullPath[i];↵ | |
14 | buf.append('/').append(node.toString());↵ | 11 | buf.append('/').append(node.toString());↵ | |
15 | }↵ | |||
16 | }↵ | |||
17 | ↵ | 12 | }↵ | |
13 | }↵ | |||
18 | setStatusBarMessage(buf.toString());↵ | 14 | //JASON: have a main application status bar setStatusBarMessage(buf.toString());↵ | |
19 | } | 15 | } | |
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 |
Number of node comparisons | 23 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
1 | final TreePath selPath = evt.getNewLeadSelectionPath(); | 1 | final TreePath selPath = evt.getNewLeadSelectionPath(); | |||||
2 | if (selPath != null) | 2 | if (selPath != null) | |||||
3 | StringBuffer buf = new StringBuffer(); | 3 | StringBuffer buf = new StringBuffer(); | |||||
4 | Object[] fullPath = selPath.getPath(); | 4 | Object[] fullPath = selPath.getPath(); | |||||
5 | for (int i = 0; i < fullPath.length; ++i) | 5 | for (int i = 0; i < fullPath.length; ++i) | |||||
6 | if (fullPath[i] instanceof ObjectTreeNode) | 6 | if (fullPath[i] instanceof ObjectTreeNode) | |||||
7 | ObjectTreeNode node = (ObjectTreeNode)fullPath[i]; | 7 | ObjectTreeNode node = (ObjectTreeNode)fullPath[i]; | |||||
8 | buf.append('/').append(node.toString()); | 8 | buf.append('/').append(node.toString()); | |||||
9 | setStatusBarMessage(buf.toString()); |
| |
Row | Violation |
---|---|
1 | Unmatched statement setStatusBarMessage(buf.toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement setStatusBarMessage(buf.toString()); 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 |