Selection[] selection = textArea.getSelection();
if(selection.length == 0)
{
view.getToolkit().beep();
return;
}
Selection[] selection = textArea.getSelection();
if(selection.length == 0)
{
view.getToolkit().beep();
return false;
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/BeanShell.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/SearchAndReplace.java
|
Method name: void showEvaluateLinesDialog(View)
|
|
Method name: boolean replace(View)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | Selection[] selection = textArea.getSelection();↵ | | 1 | Selection[] selection = textArea.getSelection();↵
|
2 | if(selection.length == 0)↵ | | 2 | if(selection.length == 0)↵
|
3 | {↵ | | 3 | {↵
|
4 | view.getToolkit().beep();↵ | | 4 | view.getToolkit().beep();↵
|
5 | return;↵ | | 5 | return false;↵
|
6 | } | | 6 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 in different classes |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | Selection[] selection = textArea.getSelection(); | | 9 | Selection[] selection = textArea.getSelection(); |
7 | if (selection.length == 0) | | 10 | if (selection.length == 0) |
8 | view.getToolkit().beep(); | | 11 | view.getToolkit().beep(); |
9 | | | | |
| | | 12 | |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched return; |
2 | Unmatched return false; |
3 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables selection |