int i = r * ncols + c;
if (i < ncomponents) {
switch (which) {
case 0:
col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width);
break;
case 1:
col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width);
break;
default:
col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width);
break;
}
} else {
break;
}
int i = r * ncols + c;
if (i < ncomponents) {
switch (which) {
case 0:
col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width);
break;
case 1:
col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width);
break;
default:
col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width);
break;
}
} 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: Dimension getLayoutSize(Container, int)
|
|
Method name: Dimension getLayoutSize(Container, int)
|
Number of AST nodes: 13
|
|
Number of AST nodes: 13
|
|
1 | int i = r * ncols + c;↵ | | 1 | int i = r * ncols + c;↵
|
2 | if (i < ncomponents) {↵ | | 2 | if (i < ncomponents) {↵
|
3 | switch (which) {↵ | | 3 | switch (which) {↵
|
4 | case 0:↵ | | 4 | case 0:↵
|
5 | col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width);↵ | | 5 | col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width);↵
|
6 | break;↵ | | 6 | break;↵
|
7 | case 1:↵ | | 7 | case 1:↵
|
8 | col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width);↵ | | 8 | col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width);↵
|
9 | break;↵ | | 9 | break;↵
|
10 | default:↵ | | 10 | default:↵
|
11 | col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width);↵ | | 11 | col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width);↵
|
12 | break;↵ | | 12 | break;↵
|
13 | }↵ | | 13 | }↵
|
14 | } else {↵ | | 14 | } else {↵
|
15 | break;↵ | | 15 | break;↵
|
16 | } | | 16 | }
|
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 | 64 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 13 |
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) | 4.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
25 | int i = r * ncols + c; | | 25 | int i = r * ncols + c; |
26 | if (i < ncomponents) | | 26 | if (i < ncomponents) |
27 | | | 27 | |
28 | | | 28 | |
29 | col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width); | | 29 | col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width); |
30 | | | 30 | |
31 | | | 31 | |
32 | col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width); | | 32 | col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width); |
33 | | | 33 | |
34 | | | 34 | |
35 | col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width); | | 35 | col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width); |
36 | | | 36 | |
| | | | |
37 | | | 37 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |