if(obj instanceof String)
{
String pane = (String)obj;
if(pane.equals(name)
|| name == null)
{
path.add(pane);
TreePath treePath = new TreePath(
path.toArray());
paneTree.scrollPathToVisible(treePath);
paneTree.setSelectionPath(treePath);
return true;
}
}
if(tocModel == null)
return;
DefaultMutableTreeNode node = (DefaultMutableTreeNode)nodes.get(shortURL);
if(node == null)
return;
TreePath path = new TreePath(tocModel.getPathToRoot(node));
toc.expandPath(path);
toc.setSelectionPath(path);
toc.scrollPathToVisible(path);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/OptionsDialog.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/help/HelpTOCPanel.java
|
Method name: boolean selectPane(OptionGroup, String, ArrayList)
|
|
Method name: void selectNode(String)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 9
|
|
1 | if(obj instanceof String)↵ | | 1 | if(↵
|
2 | {↵ | | |
|
3 | String pane = (String)obj;↵ | | |
|
4 | if(pane.equals(name)↵ | | |
|
5 | || name == null)↵ | | |
|
6 | {↵ | | |
|
7 | path.add(pane);↵ | | |
|
8 | ↵ | | 2 | tocModel == null)↵
|
| | | 3 | return;↵
|
|
| | | 4 | DefaultMutableTreeNode node = (DefaultMutableTreeNode)nodes.get(shortURL);↵
|
|
| | | 5 | if(node == null)↵
|
| | | 6 | return;↵
|
|
9 | TreePath treePath = new TreePath(↵ | | 7 | TreePath path = new TreePath(↵
|
10 | path.toArray());↵ | | |
|
11 | paneTree.scrollPathToVisible(treePath);↵ | | |
|
12 | paneTree↵ | | 8 | tocModel.getPathToRoot(node));↵
|
| | | 9 | toc.expandPath(path);↵
|
13 | .setSelectionPath(treePath);↵ | | 10 | toc.setSelectionPath(path);↵
|
14 | return true;↵ | | 11 | ↵
|
15 | }↵ | | |
|
16 | } | | 12 | toc.scrollPathToVisible(path);
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 2 |