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: Object getChild(Object, int)
|
Method name: int getIndexOfChild(Object, Object)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if (parent instanceof OptionGroup)↵ | 1 | if (parent instanceof OptionGroup)↵ | |
2 | {↵ | 2 | {↵ | |
3 | return ((OptionGroup)parent)↵ | 3 | return ((OptionGroup)parent)↵ | |
4 | .getMember(index);↵ | 4 | .getMemberIndex(child);↵ | |
5 | }↵ | 5 | }↵ | |
6 | else↵ | 6 | else↵ | |
7 | {↵ | 7 | {↵ | |
8 | return null;↵ | 8 | return -1;↵ | |
9 | } | 9 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
1 | if (parent instanceof OptionGroup) | 1 | if (parent instanceof OptionGroup) | |||||
|
| 2 | return ((OptionGroup)parent).getMemberIndex(child); | |||||
2 | return ((OptionGroup)parent).getMember(index); |
| | |||||
else | | |||||||
|
| 3 | return -1; | |||||
3 | return null; |
| |
Row | Violation |
---|---|
1 | Unmatched statement return ((OptionGroup)parent).getMemberIndex(child); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched return ((OptionGroup)parent).getMemberIndex(child); |
3 | Unmatched statement return ((OptionGroup)parent).getMember(index); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return ((OptionGroup)parent).getMember(index); |
5 | Unmatched return -1; |
6 | Unmatched return null; |