173-112-113

if (rightGradient == null) { getGradients(); } return rightGradient;
if (leftGradient == null) { getGradients(); } return leftGradient;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/celleditor/AdapterFactoryTableTreeEditor.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/celleditor/AdapterFactoryTableTreeEditor.java
Method name: `Image getRightGradient()` |  | Method name: `Image getLeftGradient()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (rightGradient == null)↵

1

    if (leftGradient == null)↵

2

        {↵

2

        {↵

3

          getGradients();↵

3

          getGradients();↵

4

        }↵

4

        }↵

5

        return rightGradient;

5

        return leftGradient;

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

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) | 0.5
   Clone type | Type 2

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

   1

       if (rightGradient == null)

   1 | if (rightGradient == null)
   1 | if (leftGradient == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rightGradient | leftGradient | VARIABLE_NAME_MISMATCH

   1

       if (leftGradient == null)

   2

       getGradients();

   2

       getGradients();

   3

       return rightGradient;

   3 | return rightGradient;
   3 | return leftGradient;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rightGradient | leftGradient | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression rightGradient cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression leftGradient cannot be parameterized, because it has dependencies to/from statements that will be extracted

   3

       return leftGradient;

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