173-21-51

if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addSerializablePropertyDescriptor(object); } return itemPropertyDescriptors;
if (filesToOpen == null) { loadFromExtensionPoints(); } return filesToOpen;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EDataTypeItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/common/ui/wizard/ExampleInstallerWizard.java
Method name: `List getPropertyDescriptors(Object)` |  | Method name: `List getFilesToOpen()`
Number of AST nodes: 4 |  | Number of AST nodes: 3

1

    if (itemPropertyDescriptors == null)↵

1

    if (↵

2

        {↵

3

          super.getPropertyDescriptors(object);↵

4

          addSerializablePropertyDescriptor(object);↵

5

        }↵

6

        return itemPropertyDescriptors↵

2

    filesToOpen == null)↵

3

        {↵

4

          loadFromExtensionPoints();↵

5

        }↵

7

    ;

6

        return filesToOpen;

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 | 7

1. {Non-refactorable}

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

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

   1

       if (itemPropertyDescriptors == null)

   1 | if (itemPropertyDescriptors == null)
   1 | if (filesToOpen == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemPropertyDescriptors | filesToOpen | VARIABLE_NAME_MISMATCH
   java.util.List | java.util.List | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> of variable itemPropertyDescriptors does not match with type java.util.List<org.eclipse.emf.common.ui.wizard.AbstractExampleInstallerWizard.FileToOpen> of variable filesToOpen
   - Make classes java.util.List and java.util.List extend a common superclass

   1

       if (filesToOpen == null)

   2

       super.getPropertyDescriptors(object);

   3

       addSerializablePropertyDescriptor(object);

   3 | addSerializablePropertyDescriptor(object);
   2 | loadFromExtensionPoints();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   addSerializablePropertyDescriptor | loadFromExtensionPoints | METHOD_INVOCATION_NAME_MISMATCH
   addSerializablePropertyDescriptor(object) | loadFromExtensionPoints() | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression addSerializablePropertyDescriptor(object) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression loadFromExtensionPoints() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression addSerializablePropertyDescriptor(object) is a void method call, and thus it cannot be parameterized
   Expression loadFromExtensionPoints() is a void method call, and thus it cannot be parameterized
   Expression addSerializablePropertyDescriptor(object) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression loadFromExtensionPoints() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression addSerializablePropertyDescriptor(object) is a void method call, and thus it cannot be parameterized
   Expression loadFromExtensionPoints() is a void method call, and thus it cannot be parameterized

   2

       loadFromExtensionPoints();

   3

       return filesToOpen;

   4

       return itemPropertyDescriptors;

   Precondition Violations (10)
   Row | Violation
   --- | ---
   1 | Type java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> of variable itemPropertyDescriptors does not match with type java.util.List<org.eclipse.emf.common.ui.wizard.AbstractExampleInstallerWizard.FileToOpen> of variable filesToOpen
   2 | Expression addSerializablePropertyDescriptor(object) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression loadFromExtensionPoints() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression addSerializablePropertyDescriptor(object) is a void method call, and thus it cannot be parameterized
   5 | Expression loadFromExtensionPoints() is a void method call, and thus it cannot be parameterized
   6 | Expression addSerializablePropertyDescriptor(object) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression loadFromExtensionPoints() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   8 | Expression addSerializablePropertyDescriptor(object) is a void method call, and thus it cannot be parameterized
   9 | Expression loadFromExtensionPoints() is a void method call, and thus it cannot be parameterized
   10 | The refactoring of the clones is infeasible, because classes org.eclipse.emf.ecore.provider.EDataTypeItemProvider and org.eclipse.emf.common.ui.wizard.ExampleInstallerWizard do not have a common superclass