if(select)
{
RectParams params = getRectParams(caret,newCaret);
int extraStartVirt;
int extraEndVirt;
if(params == null)
{
extraStartVirt = 0;
extraEndVirt = 0;
}
else
{
extraStartVirt = params.extraStartVirt;
extraEndVirt = params.extraEndVirt;
newCaret = params.newCaret;
}
extendSelection(caret,newCaret,extraStartVirt,extraEndVirt);
}
else if(!multi)
selectNone();
moveCaretPosition(newCaret);
setMagicCaretPosition(magic);
if(select)
{
RectParams params = getRectParams(caret,newCaret);
int extraStartVirt;
int extraEndVirt;
if(params == null)
{
extraStartVirt = 0;
extraEndVirt = 0;
}
else
{
extraStartVirt = params.extraStartVirt;
extraEndVirt = params.extraEndVirt;
newCaret = params.newCaret;
}
extendSelection(caret,newCaret,extraStartVirt,extraEndVirt);
}
else if(!multi)
selectNone();
moveCaretPosition(newCaret);
setMagicCaretPosition(magic);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/JEditTextArea.java
|
Method name: void goToPrevLine(boolean)
|
|
Method name: void goToNextLine(boolean)
|
Number of AST nodes: 15
|
|
Number of AST nodes: 15
|
|
1 | if(select)↵ | | 1 | if(select)↵
|
2 | {↵ | | 2 | {↵
|
3 | RectParams params = getRectParams(caret,newCaret);↵ | | 3 | RectParams params = getRectParams(caret,newCaret);↵
|
4 | int extraStartVirt;↵ | | 4 | int extraStartVirt;↵
|
5 | int extraEndVirt;↵ | | 5 | int extraEndVirt;↵
|
6 | if(params == null)↵ | | 6 | if(params == null)↵
|
7 | {↵ | | 7 | {↵
|
8 | extraStartVirt = 0;↵ | | 8 | extraStartVirt = 0;↵
|
9 | extraEndVirt = 0;↵ | | 9 | extraEndVirt = 0;↵
|
10 | }↵ | | 10 | }↵
|
11 | else↵ | | 11 | else↵
|
12 | {↵ | | 12 | {↵
|
13 | extraStartVirt = params.extraStartVirt;↵ | | 13 | extraStartVirt = params.extraStartVirt;↵
|
14 | extraEndVirt = params.extraEndVirt;↵ | | 14 | extraEndVirt = params.extraEndVirt;↵
|
15 | newCaret = params.newCaret;↵ | | 15 | newCaret = params.newCaret;↵
|
16 | }↵ | | 16 | }↵
|
17 | extendSelection(caret,newCaret,extraStartVirt,extraEndVirt);↵ | | 17 | extendSelection(caret,newCaret,extraStartVirt,extraEndVirt);↵
|
18 | }↵ | | 18 | }↵
|
19 | else if(!multi)↵ | | 19 | else if(!multi)↵
|
20 | selectNone();↵ | | 20 | selectNone();↵
|
|
21 | moveCaretPosition(newCaret);↵ | | 21 | moveCaretPosition(newCaret);↵
|
|
22 | setMagicCaretPosition(magic); | | 22 | setMagicCaretPosition(magic);
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 67 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 15 |
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) | 451.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | if (select) | | 11 | if (select) |
12 | RectParams params = getRectParams(caret, newCaret); | | 12 | RectParams params = getRectParams(caret, newCaret); |
13 | | | 13 | |
14 | | | 14 | |
15 | | | 15 | |
16 | | | 16 | |
17 | | | 17 | |
| | | | |
18 | extraStartVirt = params.extraStartVirt; | | 18 | extraStartVirt = params.extraStartVirt; |
19 | extraEndVirt = params.extraEndVirt; | | 19 | extraEndVirt = params.extraEndVirt; |
20 | newCaret = params.newCaret; | | 20 | newCaret = params.newCaret; |
21 | extendSelection(caret, newCaret, extraStartVirt, extraEndVirt); | | 21 | extendSelection(caret, newCaret, extraStartVirt, extraEndVirt); |
22 | | | 22 | |
23 | | | 23 | |
24 | moveCaretPosition(newCaret); | | 24 | moveCaretPosition(newCaret); |
25 | setMagicCaretPosition(magic); | | 25 | setMagicCaretPosition(magic); |
Precondition Violations (0)
Row |
Violation |