try { readLock(); if(offset < 0 || offset > getLength()) throw new ArrayIndexOutOfBoundsException(offset); return lineMgr.getLineOfOffset(offset); } finally { readUnlock(); }
try { readLock(); if(line < 0 || line >= lineMgr.getLineCount()) throw new ArrayIndexOutOfBoundsException(line); return lineMgr.getLineEndOffset(line); } 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 getLineOfOffset(int) Method name: int getLineEndOffset(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(line < 0 || line >= lineMgr.getLineCount())
5
				throw new ArrayIndexOutOfBoundsException(offset);
5
				throw new ArrayIndexOutOfBoundsException(line);
6
			return lineMgr.getLineOfOffset(offset);
6
			return lineMgr.getLineEndOffset(line);
7
		}
7
		}
8
		finally
8
		finally
9
		{
9
		{
10
			readUnlock();
10
			readUnlock();
11
		}
11
		}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons1