if(x > dragStartLineWidth)
{
extraEndVirt = (int)(
(x - dragStartLineWidth)
/ charWidth);
if(!getPainter().isBlockCaretEnabled()
&& !isOverwriteEnabled()
&& (x - getHorizontalOffset()) % charWidth > charWidth / 2)
{
extraEndVirt++;
}
}
if(x > dotLineWidth)
{
extraEndVirt = (int)((x - dotLineWidth) / charWidth);
if(!getPainter().isBlockCaretEnabled()
&& !isOverwriteEnabled()
&& (x - getHorizontalOffset()) % charWidth > charWidth / 2)
extraEndVirt++;
}
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 doSingleClick(MouseEvent)
|
|
Method name: void doSingleDrag(MouseEvent)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if(x > dragStartLineWidth)↵ | | 1 | if(x > dotLineWidth)↵
|
2 | {↵ | | 2 | {↵
|
3 | extraEndVirt = (int)(↵ | | 3 | extraEndVirt = (int)(↵
|
4 | (x - dragStartLineWidth)↵ | | 4 | (x - dotLineWidth)↵
|
5 | / charWidth);↵ | | 5 | / charWidth);↵
|
6 | if(!getPainter().isBlockCaretEnabled()↵ | | 6 | if(!getPainter().isBlockCaretEnabled()↵
|
7 | && !isOverwriteEnabled()↵ | | 7 | && !isOverwriteEnabled()↵
|
8 | && (x - getHorizontalOffset()) % charWidth > charWidth / 2)↵ | | 8 | && (x - getHorizontalOffset()) % charWidth > charWidth / 2)↵
|
9 | {↵ | | 9 | ↵
|
10 | extraEndVirt++;↵ | | 10 | extraEndVirt++;↵
|
11 | }↵ | | 11 | ↵
|
12 | } | | 12 | }
|
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) | 1.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | if (x > dragStartLineWidth) | | 13 | if (x > dotLineWidth) |
6 | extraEndVirt = (int)((x - dragStartLineWidth) / charWidth); | | 14 | extraEndVirt = (int)((x - dotLineWidth) / charWidth); |
7 | if (!getPainter().isBlockCaretEnabled() && !isOverwriteEnabled() && (x - getHorizontalOffset()) % charWidth > charWidth / 2) | | 15 | if (!getPainter().isBlockCaretEnabled() && !isOverwriteEnabled() && (x - getHorizontalOffset()) % charWidth > charWidth / 2) |
8 | | | 16 | |
Precondition Violations (0)
Row |
Violation |