try
{
readLock();
if(line < 0 || line >= lineMgr.getLineCount())
throw new ArrayIndexOutOfBoundsException(line);
return lineMgr.getLineEndOffset(line);
}
finally
{
readUnlock();
}
try
{
readLock();
if(offset < 0 || offset > contentMgr.getLength())
throw new ArrayIndexOutOfBoundsException(offset);
return positionMgr.createPosition(offset);
}
finally
{
readUnlock();
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/Buffer.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/Buffer.java
|
Method name: int getLineEndOffset(int)
|
|
Method name: Position createPosition(int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | try↵ | | 1 | try↵
|
2 | {↵ | | 2 | {↵
|
3 | readLock();↵ | | 3 | readLock();↵
|
|
4 | if(line < 0 || line >= lineMgr.getLineCount())↵ | | 4 | if(offset < 0 || offset > contentMgr.getLength())↵
|
5 | throw new ArrayIndexOutOfBoundsException(line);↵ | | 5 | throw new ArrayIndexOutOfBoundsException(offset);↵
|
|
6 | return lineMgr.getLineEndOffset(line);↵ | | 6 | return positionMgr.createPosition(offset);↵
|
7 | }↵ | | 7 | }↵
|
8 | finally↵ | | 8 | finally↵
|
9 | {↵ | | 9 | {↵
|
10 | readUnlock();↵ | | 10 | readUnlock();↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
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 | 1 |