for(;;) { int nextPhysicalLine = getNextVisibleLine( physicalLine); if(nextPhysicalLine == -1) break; else if(nextPhysicalLine > physicalLine + amount) break; else { scrollLine += getScreenLineCount(physicalLine); amount -= (nextPhysicalLine - physicalLine); physicalLine = nextPhysicalLine; } }
for(;;) { int prevPhysicalLine = getPrevVisibleLine( physicalLine); if(prevPhysicalLine == -1) break; else if(prevPhysicalLine < physicalLine - amount) break; else { amount -= (physicalLine - prevPhysicalLine); physicalLine = prevPhysicalLine; scrollLine -= getScreenLineCount( prevPhysicalLine); } }
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 physDown(int, int) Method name: void physUp(int, int)
Number of AST nodes: 9 Number of AST nodes: 9
1
for(;;)
1
for(;;)
2
			{
2
			{
3
				int nextPhysicalLine = getNextVisibleLine(
3
				int prevPhysicalLine = getPrevVisibleLine(
4
					physicalLine);
4
					physicalLine);
5
				if(nextPhysicalLine == -1)
5
				if(prevPhysicalLine == -1)
6
					break;
6
					break;
7
				else if(nextPhysicalLine &gt; physicalLine + amount)
7
				else if(prevPhysicalLine &lt; physicalLine - amount)
8
					break;
8
					break;
9
				else
9
				else
10
				{
10
				{
11
					scrollLine += getScreenLineCount(physicalLine);
11
					amount -= (physicalLine - prevPhysicalLine);
12
					amount -= (nextPhysicalLine - physicalLine);
12
					physicalLine = prevPhysicalLine;
13
					physicalLine = next
13
					scrollLine -= getScreenLineCount(
14
PhysicalLine;
14
						prevPhysicalLine);
15
				}
15
				}
16
			}
16
			}
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.4
Clones locationClones are declared in the same class
Number of node comparisons4