173-112-148

if (rightGradient == null) { getGradients(); } return rightGradient;
if (memberTypes == null) { setMemberTypes(basicGetMemberTypes(eDataType)); } return memberTypes;

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/ecore/util/BasicExtendedMetaData.java
Method name: `Image getRightGradient()` |  | Method name: `List getMemberTypes()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (rightGradient == null)↵

1

    if (memberTypes == null)↵

2

        {↵

2

          {↵

3

          getGradients();↵

3

            setMemberTypes(basicGetMemberTypes(eDataType));↵

4

        }↵

4

          }↵

5

        return rightGradient;

5

          return memberTypes;

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.2
Clones location | Clones are in different classes
Number of node comparisons | 5

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 2
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 22.2
   Clone type | Type 2

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

   1

       if (rightGradient == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rightGradient | memberTypes | VARIABLE_NAME_MISMATCH
   org.eclipse.swt.graphics.Image | java.util.List | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.swt.graphics.Image of variable rightGradient does not match with type java.util.List<org.eclipse.emf.ecore.EDataType> of variable memberTypes
   - Make classes org.eclipse.swt.graphics.Image and java.util.List extend a common superclass

   1

       if (memberTypes == null)

   2

       getGradients();

   2 | getGradients();
   2 | setMemberTypes(basicGetMemberTypes(eDataType));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getGradients | setMemberTypes | METHOD_INVOCATION_NAME_MISMATCH
   getGradients() | setMemberTypes(basicGetMemberTypes(eDataType)) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression getGradients() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression setMemberTypes(basicGetMemberTypes(eDataType)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression getGradients() is a void method call, and thus it cannot be parameterized
   Expression setMemberTypes(basicGetMemberTypes(eDataType)) is a void method call, and thus it cannot be parameterized
   Expression getGradients() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression setMemberTypes(basicGetMemberTypes(eDataType)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression getGradients() is a void method call, and thus it cannot be parameterized
   Expression setMemberTypes(basicGetMemberTypes(eDataType)) is a void method call, and thus it cannot be parameterized

   2

       setMemberTypes(basicGetMemberTypes(eDataType));

   3

       return memberTypes;

   3

       return rightGradient;

   Precondition Violations (10)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.swt.graphics.Image of variable rightGradient does not match with type java.util.List<org.eclipse.emf.ecore.EDataType> of variable memberTypes
   2 | Expression getGradients() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression setMemberTypes(basicGetMemberTypes(eDataType)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression getGradients() is a void method call, and thus it cannot be parameterized
   5 | Expression setMemberTypes(basicGetMemberTypes(eDataType)) is a void method call, and thus it cannot be parameterized
   6 | Expression getGradients() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression setMemberTypes(basicGetMemberTypes(eDataType)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   8 | Expression getGradients() is a void method call, and thus it cannot be parameterized
   9 | Expression setMemberTypes(basicGetMemberTypes(eDataType)) is a void method call, and thus it cannot be parameterized
   10 | The refactoring of the clones is infeasible, because classes org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTableTreeEditor and org.eclipse.emf.ecore.util.BasicExtendedMetaData.EDataTypeExtendedMetaDataImpl do not have a common superclass