if ((style & SWT.MULTI) == 0 && (style & SWT.SINGLE) == 0) { style |= SWT.SINGLE; } else if ((style & SWT.MULTI) != 0 && (style & SWT.SINGLE) != 0) { throw new IllegalArgumentException("conflicting style bits specified (sWT.MUTLI and SWT.SINGLE)"); }
if ((style & SWT.OPEN) == 0 && (style & SWT.SAVE) == 0) { style |= SWT.OPEN; } else if ((style & SWT.OPEN) != 0 && (style & SWT.SAVE) != 0) { throw new IllegalArgumentException("conflicting style bits specified (sWT.OPEN and SWT.SAVE)"); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/ui/dialogs/ResourceDialog.java File path: /emf-2.4.1/src/org/eclipse/emf/common/ui/dialogs/ResourceDialog.java
Method name: void normalizeStyle() Method name: void normalizeStyle()
Number of AST nodes: 4 Number of AST nodes: 4
1
if ((style & SWT.MULTI) == 0 && (style & SWT.SINGLE) == 0)
1
if ((style & SWT.OPEN) == 0 && (style & SWT.SAVE) == 0)
2
    {
2
    {
3
      style |= SWT.SINGLE;
3
      style |= SWT.OPEN;
4
    }
4
    }
5
    else if ((style & SWT.MULTI) != 0 && (style & SWT.SINGLE) != 0)
5
    else if ((style & SWT.OPEN) != 0 && (style & SWT.SAVE) != 0)
6
    {
6
    {
7
      throw new IllegalArgumentException("conflicting style bits specified (sWT.MUTLI and SWT.SINGLE)");
7
      throw new IllegalArgumentException("conflicting style bits specified (sWT.OPEN and SWT.SAVE)");
8
    }
8
    }
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.9
Clones locationClones are in the same method
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if ((style & SWT.MULTI) == 0 && (style & SWT.SINGLE) == 0)
    3
    if ((style & SWT.MULTI) == 0 && (style & SWT.SINGLE) == 0)
    7
    if ((style & SWT.OPEN) == 0 && (style & SWT.SAVE) == 0)
    Differences
    Expression1Expression2Difference
    MULTIOPENVARIABLE_NAME_MISMATCH
    SINGLESAVEVARIABLE_NAME_MISMATCH
    7
    if ((style & SWT.OPEN) == 0 && (style & SWT.SAVE) == 0)
    4
    style |= SWT.SINGLE;
    4
    style |= SWT.SINGLE;
    8
    style |= SWT.OPEN;
    Differences
    Expression1Expression2Difference
    SINGLEOPENVARIABLE_NAME_MISMATCH
    8
    style |= SWT.OPEN;
    5
    else if ((style & SWT.MULTI) != 0 && (style & SWT.SINGLE) != 0)
    5
    else if ((style & SWT.MULTI) != 0 && (style & SWT.SINGLE) != 0)
    9
    else if ((style & SWT.OPEN) != 0 && (style & SWT.SAVE) != 0)
    Differences
    Expression1Expression2Difference
    MULTIOPENVARIABLE_NAME_MISMATCH
    SINGLESAVEVARIABLE_NAME_MISMATCH
    9
    else if ((style & SWT.OPEN) != 0 && (style & SWT.SAVE) != 0)
    6
    throw new IllegalArgumentException("conflicting style bits specified (sWT.MUTLI and SWT.SINGLE)");
    6
    throw new IllegalArgumentException("conflicting style bits specified (sWT.MUTLI and SWT.SINGLE)");
    10
    throw new IllegalArgumentException("conflicting style bits specified (sWT.OPEN and SWT.SAVE)");
    Differences
    Expression1Expression2Difference
    "conflicting style bits specified (sWT.MUTLI and SWT.SINGLE)""conflicting style bits specified (sWT.OPEN and SWT.SAVE)"LITERAL_VALUE_MISMATCH
    10
    throw new IllegalArgumentException("conflicting style bits specified (sWT.OPEN and SWT.SAVE)");
    Precondition Violations (0)
    Row Violation