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;
}
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;
}
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: 5
|
|
Number of AST nodes: 5
|
|
1 | if (i < ncomponents) {↵ | | 1 | if (i < ncomponents) {↵
|
2 | Dimension d = parent.getComponent(i).getPreferredSize();↵ | | 2 | Dimension d = parent.getComponent(i).getPreferredSize();↵
|
3 | row_heights[r] = Math.max(row_heights[r], d.height);↵ | | 3 | row_heights[r] = Math.max(row_heights[r], d.height);↵
|
4 | col_widths[c] = Math.max(col_widths[c], d.width);↵ | | 4 | col_widths[c] = Math.max(col_widths[c], d.width);↵
|
5 | } else {↵ | | 5 | } else {↵
|
6 | break;↵ | | 6 | break;↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 39 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 3.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | if (i < ncomponents) | | 9 | if (i < ncomponents) |
10 | Dimension d = parent.getComponent(i).getPreferredSize(); | | 10 | Dimension d = parent.getComponent(i).getPreferredSize(); |
11 | row_heights[r] = Math.max(row_heights[r], d.height); | | 11 | row_heights[r] = Math.max(row_heights[r], d.height); |
12 | col_widths[c] = Math.max(col_widths[c], d.width); | | 12 | col_widths[c] = Math.max(col_widths[c], d.width); |
| | | | |
13 | | | 13 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |