103-1-4

if (isUnsettable()) { if (dataClass == null) { settingDelegate = new InternalSettingDelegateMany (InternalSettingDelegateMany.DATA_UNIQUE_UNSETTABLE_DYNAMIC, this); } else { settingDelegate = new InternalSettingDelegateMany (InternalSettingDelegateMany.DATA_UNIQUE_UNSETTABLE, dataClass, this); } } else { if (dataClass == null) { settingDelegate = new InternalSettingDelegateMany (InternalSettingDelegateMany.DATA_UNIQUE_DYNAMIC, this); } else { settingDelegate = new InternalSettingDelegateMany (InternalSettingDelegateMany.DATA_UNIQUE, dataClass, this); } }
if (isUnsettable()) { if (dataClass == null) { settingDelegate = new InternalSettingDelegateMany (InternalSettingDelegateMany.EOBJECT_UNSETTABLE_DYNAMIC, this); } else { settingDelegate = new InternalSettingDelegateMany (InternalSettingDelegateMany.EOBJECT_UNSETTABLE, dataClass, this); } } else { if (dataClass == null) { settingDelegate = new InternalSettingDelegateMany (InternalSettingDelegateMany.EOBJECT_DYNAMIC, this); } else { settingDelegate = new InternalSettingDelegateMany (InternalSettingDelegateMany.EOBJECT, dataClass, this); } }

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java
Method name: `EStructuralFeature.Internal.SettingDelegate getSettingDelegate()` |  | Method name: `EStructuralFeature.Internal.SettingDelegate getSettingDelegate()`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    if (isUnsettable())↵

1

    if (isUnsettable())↵

2

                {↵

2

                {↵

3

                  if (dataClass == null)↵

3

                  if (dataClass == null)↵

4

                  {↵

4

                  {↵

5

                    settingDelegate = ↵

5

                    settingDelegate = ↵

6

                      new InternalSettingDelegateMany↵

6

                      new InternalSettingDelegateMany↵

7

                        (InternalSettingDelegateMany.DATA_UNIQUE_UNSETTABLE_DYNAMIC, this);↵

7

                        (InternalSettingDelegateMany.EOBJECT_UNSETTABLE_DYNAMIC, this);↵

8

                  }↵

8

                  }↵

9

                  else↵

9

                  else↵

10

                  {↵

10

                  {↵

11

                    settingDelegate = ↵

11

                    settingDelegate = ↵

12

                      new InternalSettingDelegateMany↵

12

                      new InternalSettingDelegateMany↵

13

                        (InternalSettingDelegateMany.DATA_UNIQUE_UNSETTABLE, dataClass, this);↵

13

                        (InternalSettingDelegateMany.EOBJECT_UNSETTABLE, dataClass, this);↵

14

                  }↵

14

                  }↵

15

                }↵

15

                }↵

16

                else↵

16

                else↵

17

                {↵

17

                {↵

18

                  if (dataClass == null)↵

18

                  if (dataClass == null)↵

19

                  {↵

19

                  {↵

20

                    settingDelegate = ↵

20

                    settingDelegate = ↵

21

                      new InternalSettingDelegateMany↵

21

                      new InternalSettingDelegateMany↵

22

                        (InternalSettingDelegateMany.DATA_UNIQUE_DYNAMIC, this);↵

22

                        (InternalSettingDelegateMany.EOBJECT_DYNAMIC, this);↵

23

                  }↵

23

                  }↵

24

                  else↵

24

                  else↵

25

                  {↵

25

                  {↵

26

                    settingDelegate = ↵

26

                    settingDelegate = ↵

27

                      new InternalSettingDelegateMany↵

27

                      new InternalSettingDelegateMany↵

28

                        (InternalSettingDelegateMany.DATA_UNIQUE, dataClass, this);↵

28

                        (InternalSettingDelegateMany.EOBJECT, dataClass, this);↵

29

                  }↵

29

                  }↵

30

                }

30

                }

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

1. {Non-refactorable}

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

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

   53

       if (isUnsettable())

   76

       if (isUnsettable())

   54

       if (dataClass == null)

   54 | if (dataClass == null)
   77 | if (dataClass == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   java.lang.Class<> | java.lang.Class<> | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.lang.Class<> of variable dataClass does not match with type java.lang.Class<> of variable dataClass
   - Make classes java.lang.Class<> and java.lang.Class<> extend a common superclass

   77

       if (dataClass == null)

   55

       settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.DATA_UNIQUE_UNSETTABLE_DYNAMIC, this);

   55 | settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.DATA_UNIQUE_UNSETTABLE_DYNAMIC, this);
   78 | settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT_UNSETTABLE_DYNAMIC, this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   DATA_UNIQUE_UNSETTABLE_DYNAMIC | EOBJECT_UNSETTABLE_DYNAMIC | VARIABLE_NAME_MISMATCH

   78

       settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT_UNSETTABLE_DYNAMIC, this);

       else

       else

   56

       settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.DATA_UNIQUE_UNSETTABLE, dataClass, this);

   56 | settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.DATA_UNIQUE_UNSETTABLE, dataClass, this);
   79 | settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT_UNSETTABLE, dataClass, this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   DATA_UNIQUE_UNSETTABLE | EOBJECT_UNSETTABLE | VARIABLE_NAME_MISMATCH
   java.lang.Class<> | java.lang.Class<> | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.lang.Class<> of variable dataClass does not match with type java.lang.Class<> of variable dataClass
   - Make classes java.lang.Class<> and java.lang.Class<> extend a common superclass

   79

       settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT_UNSETTABLE, dataClass, this);

       else

       else

   57

       if (dataClass == null)

   57 | if (dataClass == null)
   80 | if (dataClass == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   java.lang.Class<> | java.lang.Class<> | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.lang.Class<> of variable dataClass does not match with type java.lang.Class<> of variable dataClass
   - Make classes java.lang.Class<> and java.lang.Class<> extend a common superclass

   80

       if (dataClass == null)

   58

       settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.DATA_UNIQUE_DYNAMIC, this);

   58 | settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.DATA_UNIQUE_DYNAMIC, this);
   81 | settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT_DYNAMIC, this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   DATA_UNIQUE_DYNAMIC | EOBJECT_DYNAMIC | VARIABLE_NAME_MISMATCH

   81

       settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT_DYNAMIC, this);

       else

       else

   59

       settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.DATA_UNIQUE, dataClass, this);

   59 | settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.DATA_UNIQUE, dataClass, this);
   82 | settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT, dataClass, this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   DATA_UNIQUE | EOBJECT | VARIABLE_NAME_MISMATCH
   java.lang.Class<> | java.lang.Class<> | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.lang.Class<> of variable dataClass does not match with type java.lang.Class<> of variable dataClass
   - Make classes java.lang.Class<> and java.lang.Class<> extend a common superclass

   82

       settingDelegate = new InternalSettingDelegateMany(InternalSettingDelegateMany.EOBJECT, dataClass, this);

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Type java.lang.Class<> of variable dataClass does not match with type java.lang.Class<> of variable dataClass
   2 | Type java.lang.Class<> of variable dataClass does not match with type java.lang.Class<> of variable dataClass
   3 | Type java.lang.Class<> of variable dataClass does not match with type java.lang.Class<> of variable dataClass
   4 | Type java.lang.Class<> of variable dataClass does not match with type java.lang.Class<> of variable dataClass