for(int i = 2; i < comp.length; i++) { int btnWidth = comp[i].getPreferredSize().width; if(btnWidth + x > width) { x = insets.left; y += rowHeight; } comp[i].setBounds(x,y,btnWidth,rowHeight); x += btnWidth; }
for(int i = 2; i < comp.length; i++) { int btnHeight = comp[i].getPreferredSize().height; if(btnHeight + y > height) { x += colWidth; y = insets.top; } comp[i].setBounds(x,y,colWidth,btnHeight); y += btnHeight; }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/PanelWindowContainer.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/PanelWindowContainer.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
for(int i = 2; i < comp.length; i++)
1
for(int i = 2; i < comp.length; i++)
2
				{
2
				{
3
					int btnWidth = comp[i].getPreferredSize().width;
3
					int btnHeight = comp[i].getPreferredSize().height;
4
					if(btnWidth + x > width)
4
					if(btnHeight + y > height)
5
					{
5
					{
6
						x = insets.left;
6
						x += colWidth;
7
						y += rowHeight;
7
						y = insets.top;
8
					}
8
					}
9
					comp[i].setBounds(x,y,btnWidth,rowHeight);
9
					comp[i].setBounds(x,y,colWidth,btnHeight);
10
					x += btnWidth;
10
					y += btnHeight;
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.0
Clones location
Number of node comparisons0