if(entry.win instanceof DefaultFocusComponent)
{
((DefaultFocusComponent)entry.win)
.focusOnDefaultComponent();
}
else
{
entry.win.requestDefaultFocus();
}
if(entry.win instanceof DefaultFocusComponent)
{
((DefaultFocusComponent)entry.win)
.focusOnDefaultComponent();
}
else
{
entry.win.requestDefaultFocus();
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/FloatingWindowContainer.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/PanelWindowContainer.java
|
Method name: void run()
|
|
Method name: void show(DockableWindowManager.Entry)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if(entry.win instanceof DefaultFocusComponent)↵ | | 1 | if(entry.win instanceof DefaultFocusComponent)↵
|
2 | {↵ | | 2 | ↵
|
3 | ↵ | | 3 | {↵
|
4 | ((DefaultFocusComponent)entry.win)↵ | | 4 | ((DefaultFocusComponent)entry.win)↵
|
5 | .focusOnDefaultComponent();↵ | | 5 | .focusOnDefaultComponent();↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | {↵ | | 8 | ↵
|
9 | ↵ | | 9 | {↵
|
10 | entry.win.requestDefaultFocus();↵ | | 10 | entry.win.requestDefaultFocus();↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 0.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (entry.win instanceof DefaultFocusComponent) | | 16 | if (entry.win instanceof DefaultFocusComponent) |
2 | ((DefaultFocusComponent)entry.win).focusOnDefaultComponent(); | | 17 | ((DefaultFocusComponent)entry.win).focusOnDefaultComponent(); |
| | | | |
3 | entry.win.requestDefaultFocus(); | | 18 | entry.win.requestDefaultFocus(); |
Precondition Violations (0)
Row |
Violation |