11602-2-3

int index = (j - tableOffset2 - 1) / 3; if (!info2.rainbow || info2.which == index - 1) { content[j] = info2.scale(info2.green, info2.factor[index]); }
if (j == tableOffset2 + 2 || j == tableOffset2 + 5 || j == tableOffset2 + 8 || j == tableOffset2 + 11) { int index = (j - tableOffset2 - 2) / 3; if (!info2.rainbow || info2.which == index - 1) { content[j] = info2.scale(info2.blue, info2.factor[index]); } }

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: `InputStream generateGIF(String, String)` |  | Method name: `InputStream generateGIF(String, String)`
Number of AST nodes: 3 |  | Number of AST nodes: 4

1

    if (j == tableOffset2 + 2 || j == tableOffset2 + 5 || j == tableOffset2 + 8 || j == tableOffset2 + 11)↵

2

              {↵

1

    int index = (j - tableOffset2 - 1) / 3;↵

3

                int index = (j - tableOffset2 - 2) / 3;↵

2

                if (!info2.rainbow || info2.which == index - 1)↵

4

                if (!info2.rainbow || info2.which == index - 1)↵

3

                {↵

5

                {↵

4

                  content[j] = info2.scale(info2.green, info2.factor[index]);↵

6

                  content[j] = info2.scale(info2.blue, info2.factor[index]);↵

5

                }

7

                }↵

8

              }

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.5
Clones location | Clones are in the same method
Number of node comparisons | 7

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 3
   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) | 1.0
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   26

       int index = (j - tableOffset2 - 1) / 3;

   26 | int index = (j - tableOffset2 - 1) / 3;
   30 | int index = (j - tableOffset2 - 2) / 3;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   1 | 2 | LITERAL_VALUE_MISMATCH

   30

       int index = (j - tableOffset2 - 2) / 3;

   27

       if (!info2.rainbow || info2.which == index - 1)

   31

       if (!info2.rainbow || info2.which == index - 1)

   28

       content[j] = info2.scale(info2.green, info2.factor[index]);

   28 | content[j] = info2.scale(info2.green, info2.factor[index]);
   32 | content[j] = info2.scale(info2.blue, info2.factor[index]);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   green | blue | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression info2.green cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression info2.blue cannot be parameterized, because it has dependencies to/from statements that will be extracted

   32

       content[j] = info2.scale(info2.blue, info2.factor[index]);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Expression info2.green cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression info2.blue cannot be parameterized, because it has dependencies to/from statements that will be extracted