File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/OptionsDialog.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/OptionsDialog.java | |||
Method name: boolean selectPane(OptionGroup, String, ArrayList)
|
Method name: boolean selectPane(OptionGroup, String, ArrayList)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | OptionPane pane = (OptionPane)obj;↵ | 1 | String pane = (String)obj;↵ | |
2 | if(pane.getName().equals(name)↵ | 2 | if(pane.equals(name)↵ | |
3 | || name == null)↵ | 3 | || name == null)↵ | |
4 | {↵ | 4 | {↵ | |
5 | path.add(pane);↵ | 5 | path.add(pane);↵ | |
6 | TreePath treePath = new TreePath(↵ | 6 | TreePath treePath = new TreePath(↵ | |
7 | path.toArray());↵ | 7 | path.toArray());↵ | |
8 | paneTree.scrollPathToVisible(treePath);↵ | 8 | paneTree.scrollPathToVisible(treePath);↵ | |
9 | paneTree.setSelectionPath(treePath);↵ | 9 | paneTree.setSelectionPath(treePath);↵ | |
10 | return true;↵ | 10 | return true;↵ | |
11 | } | 11 |
| |
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 the same method |
Number of node comparisons | 39 |
Number of mapped statements | 6 |
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) | 4.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17 | OptionPane pane = (OptionPane)obj; |
| | ||||||||||||
|
| 25 | String pane = (String)obj; | ||||||||||||
18 | if (pane.getName().equals(name) || name == null) |
| 26 | if (pane.equals(name) || name == null) | |||||||||||
19 | path.add(pane); |
| 27 | path.add(pane); | |||||||||||
20 | TreePath treePath = new TreePath(path.toArray()); | 28 | TreePath treePath = new TreePath(path.toArray()); | ||||||||||||
21 | paneTree.scrollPathToVisible(treePath); | 29 | paneTree.scrollPathToVisible(treePath); | ||||||||||||
22 | paneTree.setSelectionPath(treePath); | 30 | paneTree.setSelectionPath(treePath); | ||||||||||||
23 | return true; |
| 31 | return true; |
Row | Violation |
---|---|
1 | Unmatched statement OptionPane pane=(OptionPane)obj; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement String pane=(String)obj; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type org.gjt.sp.jedit.OptionPane of variable pane does not match with type java.lang.String of variable pane |
4 | Conditional return true; |
5 | Conditional return true; |