173-2-66

if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addOrderedPropertyDescriptor(object); addUniquePropertyDescriptor(object); addLowerBoundPropertyDescriptor(object); addUpperBoundPropertyDescriptor(object); addManyPropertyDescriptor(object); addRequiredPropertyDescriptor(object); addETypePropertyDescriptor(object); } return itemPropertyDescriptors;
if (genBaseToDetailsMap == null) { genBaseToDetailsMap = new HashMap<GenBase, EMap<String, String>>(); } return genBaseToDetailsMap;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/ETypedElementItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/exporter/ModelExporter.java
Method name: `List getPropertyDescriptors(Object)` |  | Method name: `Map> getGenBaseToGenAnnotationDetailsMap()`
Number of AST nodes: 10 |  | Number of AST nodes: 3

1

    if (itemPropertyDescriptors == null)↵

1

    if (↵

2

        {↵

3

          super.getPropertyDescriptors(object);↵

4

          addOrderedPropertyDescriptor(object);↵

5

          addUniquePropertyDescriptor(object);↵

6

          addLowerBoundPropertyDescriptor(object);↵

7

          addUpperBoundPropertyDescriptor(object);↵

8

          addManyPropertyDescriptor(object);↵

9

          addRequiredPropertyDescriptor(object);↵

10

          addETypePropertyDescriptor(object);↵

11

        }↵

12

        return itemPropertyDescriptors↵

2

    genBaseToDetailsMap == null)↵

3

        {↵

4

          genBaseToDetailsMap = new HashMap<GenBase, EMap<String, String>>();↵

5

        }↵

13

    ;

6

        return genBaseToDetailsMap;

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 in different classes
Number of node comparisons | 19

1. {Non-refactorable}

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

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

   1

       if (itemPropertyDescriptors == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemPropertyDescriptors | genBaseToDetailsMap | VARIABLE_NAME_MISMATCH
   java.util.List | java.util.Map> | 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.Map<org.eclipse.emf.codegen.ecore.genmodel.GenBase,org.eclipse.emf.common.util.EMap<java.lang.String,java.lang.String>> of variable genBaseToDetailsMap
   - Make classes java.util.List and java.util.Map> extend a common superclass

   1

       if (genBaseToDetailsMap == null)

   2

       genBaseToDetailsMap = new HashMap<GenBase, EMap<String, String>>();

   2

       super.getPropertyDescriptors(object);

   3

       addOrderedPropertyDescriptor(object);

   4

       addUniquePropertyDescriptor(object);

   5

       addLowerBoundPropertyDescriptor(object);

   6

       addUpperBoundPropertyDescriptor(object);

   7

       addManyPropertyDescriptor(object);

   8

       addRequiredPropertyDescriptor(object);

   9

       addETypePropertyDescriptor(object);

   3 | return genBaseToDetailsMap;

   Preondition Violations
   Unmatched return genBaseToDetailsMap;

   3

       return genBaseToDetailsMap;

   10

       return itemPropertyDescriptors;

   10 | return itemPropertyDescriptors;

   Preondition Violations
   Unmatched return itemPropertyDescriptors;

   Precondition Violations (3)
   Row | Violation
   --- | ---
   1 | Type java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> of variable itemPropertyDescriptors does not match with type java.util.Map<org.eclipse.emf.codegen.ecore.genmodel.GenBase,org.eclipse.emf.common.util.EMap<java.lang.String,java.lang.String>> of variable genBaseToDetailsMap
   2 | Unmatched return genBaseToDetailsMap;
   3 | Unmatched return itemPropertyDescriptors;