for (int r = 0, y = insets.top, i = 0; r < nrows; y += row_heights[r] + vgap, r++) {
for (int c = 0, x = insets.left; c < ncols; x += col_widths[c] + hgap, c++, i++) {
if (i < ncomponents) {
parent.getComponent(i).setBounds(x, y, col_widths[c], row_heights[r]);
}
}
}
for (int r = 0, y = insets.top, i = 0; r < nrows; y += row_heights[r] + vgap, r++) {
for (int c = 0, x = insets.left; c < ncols; x += col_widths[c] + hgap, c++, i++) {
if (i < ncomponents) {
parent.getComponent(i).setBounds(x, y, col_widths[c], 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: void layoutContainer(Container)
|
|
Method name: void layoutContainer(Container)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (int r = 0, y = insets.top, i = 0; r < nrows; y += row_heights[r] + vgap, r++) {↵ | | 1 | for (int r = 0, y = insets.top, i = 0; r < nrows; y += row_heights[r] + vgap, r++) {↵
|
2 | for (int c = 0, x = insets.left; c < ncols; x += col_widths[c] + hgap, c++, i++) {↵ | | 2 | for (int c = 0, x = insets.left; c < ncols; x += col_widths[c] + hgap, c++, i++) {↵
|
3 | if (i < ncomponents) {↵ | | 3 | if (i < ncomponents) {↵
|
4 | parent.getComponent(i).setBounds(x, y, col_widths[c], row_heights[r]);↵ | | 4 | parent.getComponent(i).setBounds(x, y, col_widths[c], row_heights[r]);↵
|
5 | }↵ | | 5 | }↵
|
6 | }↵ | | 6 | }↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 24 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
30 | for (int r = 0, y = insets.top, i = 0; r < nrows; y += row_heights[r] + vgap, r++) | | 30 | for (int r = 0, y = insets.top, i = 0; r < nrows; y += row_heights[r] + vgap, r++) |
31 | for (int c = 0, x = insets.left; c < ncols; x += col_widths[c] + hgap, c++, i++) | | 31 | for (int c = 0, x = insets.left; c < ncols; x += col_widths[c] + hgap, c++, i++) |
32 | | | 32 | |
33 | parent.getComponent(i).setBounds(x, y, col_widths[c], row_heights[r]); | | 33 | parent.getComponent(i).setBounds(x, y, col_widths[c], row_heights[r]); |
Precondition Violations (0)
Row |
Violation |