switch (which) { case 0: row_height = Math.max(row_height, parent.getComponent(i).getMinimumSize().height); break; case 1: row_height = Math.max(row_height, parent.getComponent(i).getMaximumSize().height); break; default: row_height = Math.max(row_height, parent.getComponent(i).getPreferredSize().height); 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/installer/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
								row_height = Math.max(row_height, parent.getComponent(i).getMinimumSize().height);
3
								col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width);
4
								break;
4
								break;
5
							case 1:
5
							case 1:
6
								row_height = Math.max(row_height, parent.getComponent(i).getMaximumSize().height);
6
								col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width);
7
								break;
7
								break;
8
							default:
8
							default:
9
								row_height = Math.max(row_height, parent.getComponent(i).getPreferredSize().height);
9
								col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width);
10
								break;
10
								break;
11
						}
11
						}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons60
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)13.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    switch (which)
    27
    switch (which)
    11
    case 0:
    28
    case 0:
    12
    row_height = Math.max(row_height, parent.getComponent(i).getMinimumSize().height);
    12
    row_height = Math.max(row_height, parent.getComponent(i).getMinimumSize().height);
    29
    col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width);
    Differences
    Expression1Expression2Difference
    row_heightcol_widthVARIABLE_NAME_MISMATCH
    row_heightcol_widthVARIABLE_NAME_MISMATCH
    heightwidthVARIABLE_NAME_MISMATCH
    29
    col_width = Math.max(col_width, parent.getComponent(i).getMinimumSize().width);
    13
    break;
    30
    break;
    14
    case 1:
    31
    case 1:
    15
    row_height = Math.max(row_height, parent.getComponent(i).getMaximumSize().height);
    15
    row_height = Math.max(row_height, parent.getComponent(i).getMaximumSize().height);
    32
    col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width);
    Differences
    Expression1Expression2Difference
    row_heightcol_widthVARIABLE_NAME_MISMATCH
    row_heightcol_widthVARIABLE_NAME_MISMATCH
    heightwidthVARIABLE_NAME_MISMATCH
    32
    col_width = Math.max(col_width, parent.getComponent(i).getMaximumSize().width);
    16
    break;
    33
    break;
    17
    default:
    34
    default:
    18
    row_height = Math.max(row_height, parent.getComponent(i).getPreferredSize().height);
    18
    row_height = Math.max(row_height, parent.getComponent(i).getPreferredSize().height);
    35
    col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width);
    Differences
    Expression1Expression2Difference
    row_heightcol_widthVARIABLE_NAME_MISMATCH
    row_heightcol_widthVARIABLE_NAME_MISMATCH
    heightwidthVARIABLE_NAME_MISMATCH
    35
    col_width = Math.max(col_width, parent.getComponent(i).getPreferredSize().width);
    19
    break;
    36
    break;
    Precondition Violations (0)
    Row Violation