green += change; if (green >= 192) { which = 2; change = -change; } else if (green <= 64) { which = 2; change = -change; } break;
blue += change; if (blue >= 192) { which = 0; change = -change; } else if (blue <=64) { which = 0; change = -change; } break;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/ExtendedImageRegistry.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/ExtendedImageRegistry.java
Method name: void generateColor() Method name: void generateColor()
Number of AST nodes: 8 Number of AST nodes: 8
1
green += change;
1
blue += change;
2
          if (green >= 192)
2
          if (blue >= 192)
3
          {
3
          {
4
            which = 2;
4
            which = 0;
5
            change = -change;
5
            change = -change;
6
          }
6
          }
7
          else if (green <= 64)
7
          else if (blue <=64)
8
          {
8
          {
9
            which = 2;
9
            which = 0;
10
            change = -change;
10
            change = -change;
11
          }
11
          }
12
          break;
12
          break;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons33
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    green += change;
    12
    green += change;
    21
    blue += change;
    Differences
    Expression1Expression2Difference
    greenblueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression green is a field being modified, and thus it cannot be parameterized
    Expression blue is a field being modified, and thus it cannot be parameterized
    21
    blue += change;
    13
    if (green >= 192)
    13
    if (green >= 192)
    22
    if (blue >= 192)
    Differences
    Expression1Expression2Difference
    greenblueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression green cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression blue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22
    if (blue >= 192)
    14
    which = 2;
    14
    which = 2;
    23
    which = 0;
    Differences
    Expression1Expression2Difference
    20LITERAL_VALUE_MISMATCH
    23
    which = 0;
    15
    change = -change;
    24
    change = -change;
    16
    else if (green <= 64)
    16
    else if (green <= 64)
    25
    else if (blue <= 64)
    Differences
    Expression1Expression2Difference
    greenblueVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression green cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression blue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25
    else if (blue <= 64)
    17
    which = 2;
    17
    which = 2;
    26
    which = 0;
    Differences
    Expression1Expression2Difference
    20LITERAL_VALUE_MISMATCH
    26
    which = 0;
    18
    change = -change;
    27
    change = -change;
    19
    break;
    28
    break;
    Precondition Violations (6)
    Row Violation
    1Expression green is a field being modified, and thus it cannot be parameterized
    2Expression blue is a field being modified, and thus it cannot be parameterized
    3Expression green cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression blue cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression green cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression blue cannot be parameterized, because it has dependencies to/from statements that will be extracted