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 getLineOfOffset(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(offset < 0 || offset > getLength())↵ | 4 | if(offset < 0 || offset > contentMgr.getLength())↵ | |
5 | throw new ArrayIndexOutOfBoundsException(offset);↵ | 5 | throw new ArrayIndexOutOfBoundsException(offset);↵ | |
6 | return lineMgr.getLineOfOffset(offset);↵ | 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 |
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 | 13 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | try | 1 | try | |||||||||||
2 | readLock(); | 2 | readLock(); | |||||||||||
3 | if (offset < 0 || offset > getLength()) |
| 3 | if (offset < 0 || offset > contentMgr.getLength()) | ||||||||||
4 | throw new ArrayIndexOutOfBoundsException(offset); | 4 | throw new ArrayIndexOutOfBoundsException(offset); | |||||||||||
|
| 5 | return positionMgr.createPosition(offset); | |||||||||||
5 | return lineMgr.getLineOfOffset(offset); |
| |
Row | Violation |
---|---|
1 | Unmatched return positionMgr.createPosition(offset); |
2 | Unmatched return lineMgr.getLineOfOffset(offset); |