Selection s = textArea.getSelectionAtOffset(
textArea.getCaretPosition());
if(s == null)
start = textArea.getCaretPosition();
else if(_reverse)
start = s.getStart();
else
start = s.getEnd();
Selection s = textArea.getSelectionAtOffset(
textArea.getCaretPosition());
if(s == null)
start = textArea.getCaretPosition();
else if(reverse)
start = s.getStart();
else
start = s.getEnd();
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/SearchAndReplace.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/SearchBar.java
|
Method name: boolean find(View)
|
|
Method name: void find(boolean)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | Selection s = textArea.getSelectionAtOffset(↵ | | 1 | Selection s = textArea.getSelectionAtOffset(↵
|
2 | textArea.getCaretPosition());↵ | | 2 | textArea.getCaretPosition());↵
|
3 | if(s == null)↵ | | 3 | if(s == null)↵
|
4 | start = textArea.getCaretPosition();↵ | | 4 | start = textArea.getCaretPosition();↵
|
5 | else if(_reverse)↵ | | 5 | else if(reverse)↵
|
6 | start = s.getStart();↵ | | 6 | start = s.getStart();↵
|
7 | else↵ | | 7 | else↵
|
8 | start = s.getEnd(); | | 8 | start = s.getEnd();
|
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 21 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 1.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
31 | Selection s = textArea.getSelectionAtOffset(textArea.getCaretPosition()); | | 18 | Selection s = textArea.getSelectionAtOffset(textArea.getCaretPosition()); |
32 | if (s == null) | | 19 | if (s == null) |
33 | start = textArea.getCaretPosition(); | | 20 | start = textArea.getCaretPosition(); |
34 | | | 21 | |
35 | | | 22 | |
| | | | |
36 | | | 23 | |
Precondition Violations (0)
Row |
Violation |