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;
}
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;
}
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: 10
|
|
Number of AST nodes: 10
|
|
1 | switch (which) {↵ | | 1 | switch (which) {↵
|
2 | case 0:↵ | | 2 | case 0:↵
|
3 | col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width);↵ | | 3 | col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width);↵
|
4 | break;↵ | | 4 | break;↵
|
5 | case 1:↵ | | 5 | case 1:↵
|
6 | col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width);↵ | | 6 | col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width);↵
|
7 | break;↵ | | 7 | break;↵
|
8 | default:↵ | | 8 | default:↵
|
9 | col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width);↵ | | 9 | col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width);↵
|
10 | break;↵ | | 10 | break;↵
|
11 | } | | 11 | }
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 60 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 10 |
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.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
27 | switch (which) | | 27 | switch (which) |
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 | |
Precondition Violations (0)
Row |
Violation |