106-1-3

if (isUnsettable()) { if (isResolveProxies()) { settingDelegate = new InternalSettingDelegateSingleEObjectContainmentUnsettableResolving((EClass)eType, this); } else { settingDelegate = new InternalSettingDelegateSingleEObjectContainmentUnsettable((EClass)eType, this); } } else { if (isResolveProxies()) { settingDelegate = new InternalSettingDelegateSingleEObjectContainmentResolving((EClass)eType, this); } else { settingDelegate = new InternalSettingDelegateSingleEObjectContainment((EClass)eType, this); } }
if (eOpposite == null) { if (isUnsettable()) { settingDelegate = new InternalSettingDelegateSingleEObjectUnsettable((EClass)eType, this); } else { settingDelegate = new InternalSettingDelegateSingleEObject((EClass)eType, this); } } else { if (isUnsettable()) { settingDelegate = new InternalSettingDelegateSingleEObjectWithInverseUnsettable((EClass)eType, this, eOpposite); } else { settingDelegate = new InternalSettingDelegateSingleEObjectWithInverse((EClass)eType, this, eOpposite); } }

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

2

      ↵

2

    eOpposite == null)↵

3

            {↵

3

            {↵

4

                if (isResolveProxies())↵

4

              if (isUnsettable())↵

5

                {↵

5

              ↵

6

      ↵

6

    {↵

7

                settingDelegate = new InternalSettingDelegateSingleEObjectContainmentUnsettableResolving((EClass)eType, this);↵

7

                settingDelegate = new InternalSettingDelegateSingleEObjectUnsettable((EClass)eType, this);↵

8

                }↵

8

              }↵

9

                else↵

9

              else↵

10

                {↵

10

              ↵

11

      ↵

11

    {↵

12

                settingDelegate = new InternalSettingDelegateSingleEObjectContainmentUnsettable((EClass)eType, this);↵

12

                settingDelegate = new InternalSettingDelegateSingleEObject((EClass)eType, this);↵

13

                }↵

13

              ↵

14

      ↵

14

    }↵

15

            }↵

15

            }↵

16

              else↵

16

            else↵

17

              {↵

17

            ↵

18

      ↵

18

    {↵

19

              if (isResolveProxies())↵

19

              if (isUnsettable())↵

20

                {↵

20

              ↵

21

      ↵

21

    {↵

22

                settingDelegate = new InternalSettingDelegateSingleEObjectContainmentResolving((EClass)eType, this);↵

22

                settingDelegate = new InternalSettingDelegateSingleEObjectWithInverseUnsettable((EClass)eType, this, eOpposite);↵

23

                }↵

23

              ↵

24

      ↵

24

    }↵

25

              else↵

25

              else↵

26

                {↵

26

              ↵

27

      ↵

27

    {↵

28

                settingDelegate = new InternalSettingDelegateSingleEObjectContainment((EClass)eType, this);↵

28

                settingDelegate = new InternalSettingDelegateSingleEObjectWithInverse((EClass)eType, this, eOpposite);↵

29

                }↵

29

              ↵

30

      ↵

30

    }↵

31

            }

31

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 2
Number of refactorable cases | 2
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3
Clones location | Clones are in the same method
Number of node comparisons | 21

1. {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) | 1.9
   Clone type | Type 2

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

   131

       if (isResolveProxies())

   131 | if (isResolveProxies())
   153 | if (isUnsettable())

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   isResolveProxies | isUnsettable | METHOD_INVOCATION_NAME_MISMATCH

   153

       if (isUnsettable())

   132

       settingDelegate = new InternalSettingDelegateSingleEObjectContainmentUnsettableResolving((EClass)eType, this);

   132 | settingDelegate = new InternalSettingDelegateSingleEObjectContainmentUnsettableResolving((EClass)eType, this);
   154 | settingDelegate = new InternalSettingDelegateSingleEObjectUnsettable((EClass)eType, this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.InternalSettingDelegateSingleEObjectContainmentUnsettableResolving | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.InternalSettingDelegateSingleEObjectUnsettable | SUBCLASS_TYPE_MISMATCH

   154

       settingDelegate = new InternalSettingDelegateSingleEObjectUnsettable((EClass)eType, this);

       else

       else

   133

       settingDelegate = new InternalSettingDelegateSingleEObjectContainmentUnsettable((EClass)eType, this);

   133 | settingDelegate = new InternalSettingDelegateSingleEObjectContainmentUnsettable((EClass)eType, this);
   155 | settingDelegate = new InternalSettingDelegateSingleEObject((EClass)eType, this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.InternalSettingDelegateSingleEObjectContainmentUnsettable | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.InternalSettingDelegateSingleEObject | SUBCLASS_TYPE_MISMATCH

   155

       settingDelegate = new InternalSettingDelegateSingleEObject((EClass)eType, this);

   Precondition Violations (0)
   Row | Violation
   --- | ---

2. {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) | 1.3
   Clone type | Type 2

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

   134

       if (isResolveProxies())

   134 | if (isResolveProxies())
   153 | if (isUnsettable())

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   isResolveProxies | isUnsettable | METHOD_INVOCATION_NAME_MISMATCH

   153

       if (isUnsettable())

   135

       settingDelegate = new InternalSettingDelegateSingleEObjectContainmentResolving((EClass)eType, this);

   135 | settingDelegate = new InternalSettingDelegateSingleEObjectContainmentResolving((EClass)eType, this);
   154 | settingDelegate = new InternalSettingDelegateSingleEObjectUnsettable((EClass)eType, this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.InternalSettingDelegateSingleEObjectContainmentResolving | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.InternalSettingDelegateSingleEObjectUnsettable | SUBCLASS_TYPE_MISMATCH

   154

       settingDelegate = new InternalSettingDelegateSingleEObjectUnsettable((EClass)eType, this);

       else

       else

   136

       settingDelegate = new InternalSettingDelegateSingleEObjectContainment((EClass)eType, this);

   136 | settingDelegate = new InternalSettingDelegateSingleEObjectContainment((EClass)eType, this);
   155 | settingDelegate = new InternalSettingDelegateSingleEObject((EClass)eType, this);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.InternalSettingDelegateSingleEObjectContainment | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.InternalSettingDelegateSingleEObject | SUBCLASS_TYPE_MISMATCH

   155

       settingDelegate = new InternalSettingDelegateSingleEObject((EClass)eType, this);

   Precondition Violations (0)
   Row | Violation
   --- | ---