for (int r = 0, i = 0; r < nrows; r++) { for (int c = 0; c < ncols; c++, i++) { if (i < ncomponents) { Dimension d = parent.getComponent(i).getPreferredSize(); row_heights[r] = Math.max(row_heights[r], d.height); col_widths[c] = Math.max(col_widths[c], d.width); } else { break; } } total_height += row_heights[r]; }
for (int r = 0, i = 0; r < nrows; r++) { for (int c = 0; c < ncols; c++, i++) { if (i < ncomponents) { Dimension d = parent.getComponent(i).getPreferredSize(); row_heights[r] = Math.max(row_heights[r], d.height); col_widths[c] = Math.max(col_widths[c], d.width); } else { break; } } total_height += row_heights[r]; }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/VariableGridLayout.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/VariableGridLayout.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
for (int r = 0, i = 0; r < nrows; r++) {
1
for (int r = 0, i = 0; r < nrows; r++) {
2
				for (int c = 0; c < ncols; c++, i++) {
2
				for (int c = 0; c < ncols; c++, i++) {
3
					if (i < ncomponents) {
3
					if (i < ncomponents) {
4
						Dimension d = parent.getComponent(i).getPreferredSize();
4
						Dimension d = parent.getComponent(i).getPreferredSize();
5
						row_heights[r] = Math.max(row_heights[r], d.height);
5
						row_heights[r] = Math.max(row_heights[r], d.height);
6
						col_widths[c] = Math.max(col_widths[c], d.width);
6
						col_widths[c] = Math.max(col_widths[c], d.width);
7
					} else {
7
					} else {
8
						break;
8
						break;
9
					}
9
					}
10
				}
10
				}
11
				total_height += row_heights[r];
11
				total_height += row_heights[r];
12
			}
12
			}
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