start = line + 1;
for(int i = line + 1; i < lineCount; i++)
{
if(buffer.getFoldLevel(i) <= initialFoldLevel)
{
end = i - 1;
break;
}
}
start = line + 1;
for(int i = line + 1; i < lineCount; i++)
{
if(/* isLineVisible(i) && */
buffer.getFoldLevel(i) <= initialFoldLevel)
{
end = i - 1;
break;
}
}
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 collapseFold(int)
|
|
Method name: int expandFold(int, boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | start = line + 1;↵ | | 1 | start = line + 1;↵
|
|
2 | for(int i = line + 1; i < lineCount; i++)↵ | | 2 | for(int i = line + 1; i < lineCount; i++)↵
|
3 | {↵ | | 3 | {↵
|
4 | if(↵ | | 4 | if(/* isLineVisible(i) && */↵
|
5 | buffer.getFoldLevel(i) <= initialFoldLevel)↵ | | 5 | buffer.getFoldLevel(i) <= initialFoldLevel)↵
|
6 | {↵ | | 6 | {↵
|
7 | end = i - 1;↵ | | 7 | end = i - 1;↵
|
8 | break;↵ | | 8 | break;↵
|
9 | }↵ | | 9 | }↵
|
10 | } | | 10 | }
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | start = line + 1; | | 14 | start = line + 1; |
9 | for (int i = line + 1; i < lineCount; i++) | | 15 | for (int i = line + 1; i < lineCount; i++) |
10 | if (buffer.getFoldLevel(i) <= initialFoldLevel) | | 16 | if (buffer.getFoldLevel(i) <= initialFoldLevel) |
11 | | | 17 | |
12 | | | 18 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables start, end , while Clone fragment #2 returns variables start, end |