if(amount < screenLines)
{
skew = amount;
break;
}
else
{
int nextLine = getNextVisibleLine(physicalLine);
if(nextLine == -1)
break;
boolean visible = isLineVisible(physicalLine);
physicalLine = nextLine;
if(visible)
{
amount -= screenLines;
scrollLine += screenLines;
}
}
int prevLine = getPrevVisibleLine(physicalLine);
if(prevLine == -1)
break;
physicalLine = prevLine;
int screenLines = getScreenLineCount(physicalLine);
scrollLine -= screenLines;
if(amount < screenLines)
{
skew = screenLines - amount;
break;
}
else
amount -= screenLines;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/DisplayManager.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/DisplayManager.java
|
Method name: void scrollDown(int)
|
|
Method name: void scrollUp(int)
|
Number of AST nodes: 11
|
|
Number of AST nodes: 10
|
|
1 | if(amount < screenLines)↵ | | 1 | i↵
|
2 | {↵ | | |
|
3 | skew = amount;↵ | | |
|
4 | break;↵ | | |
|
5 | }↵ | | |
|
6 | else↵ | | |
|
7 | {↵ | | |
|
8 | int nextLine = getNextVisibleLine(physicalLine);↵ | | 2 | nt prevLine = getPrevVisibleLine(physicalLine);↵
|
9 | if(nextLine == -1)↵ | | 3 | if(prevLine == -1)↵
|
10 | break;↵ | | 4 | break;↵
|
11 | boolean visible = isLineVisible↵ | | 5 | physicalLine = prevLine;↵
|
|
12 | (physicalLine);↵ | | 6 | int screenLines = getScreenLineCount(physicalLine);↵
|
13 | physicalLine = nextLine;↵ | | 7 | scrollLine -= screenLines;↵
|
14 | if(visible)↵ | | 8 | if(amount < screenLines)↵
|
15 | {↵ | | 9 | {↵
|
16 | amount -= screenLines;↵ | | 10 | skew = screenLines↵
|
17 | scrollLine +↵ | | 11 | - amount;↵
|
| | | 12 | break;↵
|
| | | 13 | }↵
|
| | | 14 | else↵
|
18 | = screenLines;↵ | | 15 | amount -= screenLines;
|
19 | }↵ | | | |
20 | } | | | |
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 declared in the same class |
Number of node comparisons | 9 |
-
{Non-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) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | int nextLine = getNextVisibleLine(physicalLine); | | 9 | int prevLine = getPrevVisibleLine(physicalLine); |
12 | if (nextLine == -1) | | 10 | if (prevLine == -1) |
13 | | | 11 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |