11396-4-13

boolean oldChangeable = (eFlags & CHANGEABLE_EFLAG) != 0; if (newChangeable) eFlags |= CHANGEABLE_EFLAG; else eFlags &= ~CHANGEABLE_EFLAG; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ESTRUCTURAL_FEATURE__CHANGEABLE, oldChangeable, newChangeable));
boolean oldDerived = (eFlags & DERIVED_EFLAG) != 0; if (newDerived) eFlags |= DERIVED_EFLAG; else eFlags &= ~DERIVED_EFLAG; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ESTRUCTURAL_FEATURE__DERIVED, oldDerived, newDerived));

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: `void setChangeable(boolean)` |  | Method name: `void setDerived(boolean)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    boolean oldChangeable = (eFlags & CHANGEABLE_EFLAG) != 0;↵

1

    boolean oldDerived = (eFlags & DERIVED_EFLAG) != 0;↵

2

        if (newChangeable) eFlags |= CHANGEABLE_EFLAG; else eFlags &= ~CHANGEABLE_EFLAG;↵

2

        if (newDerived) eFlags |= DERIVED_EFLAG; else eFlags &= ~DERIVED_EFLAG;↵

3

        if (eNotificationRequired())↵

3

        if (eNotificationRequired())↵

4

          eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ESTRUCTURAL_FEATURE__CHANGEABLE, oldChangeable, newChangeable));

4

          eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ESTRUCTURAL_FEATURE__DERIVED, oldDerived, newDerived));

See real code fragment |  | See real code fragment

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

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 6
   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
   --- | --- | --- | --- | ---

   1

       boolean oldChangeable = (eFlags & CHANGEABLE_EFLAG) != 0;

   1 | boolean oldChangeable = (eFlags & CHANGEABLE_EFLAG) != 0;
   1 | boolean oldDerived = (eFlags & DERIVED_EFLAG) != 0;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   oldChangeable | oldDerived | VARIABLE_NAME_MISMATCH
   CHANGEABLE_EFLAG | DERIVED_EFLAG | VARIABLE_NAME_MISMATCH

   1

       boolean oldDerived = (eFlags & DERIVED_EFLAG) != 0;

   2

       if (newChangeable)

   2 | if (newChangeable)
   2 | if (newDerived)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   newChangeable | newDerived | VARIABLE_NAME_MISMATCH

   2

       if (newDerived)

   3

       eFlags |= CHANGEABLE_EFLAG;

   3 | eFlags |= CHANGEABLE_EFLAG;
   3 | eFlags |= DERIVED_EFLAG;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   CHANGEABLE_EFLAG | DERIVED_EFLAG | VARIABLE_NAME_MISMATCH

   3

       eFlags |= DERIVED_EFLAG;

       else

       else

   4

       eFlags &= ~CHANGEABLE_EFLAG;

   4 | eFlags &= ~CHANGEABLE_EFLAG;
   4 | eFlags &= ~DERIVED_EFLAG;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   CHANGEABLE_EFLAG | DERIVED_EFLAG | VARIABLE_NAME_MISMATCH

   4

       eFlags &= ~DERIVED_EFLAG;

   5

       if (eNotificationRequired())

   5

       if (eNotificationRequired())

   6

       eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ESTRUCTURAL_FEATURE__CHANGEABLE, oldChangeable, newChangeable));

   6 | eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ESTRUCTURAL_FEATURE__CHANGEABLE, oldChangeable, newChangeable));
   6 | eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ESTRUCTURAL_FEATURE__DERIVED, oldDerived, newDerived));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   ESTRUCTURAL_FEATURE__CHANGEABLE | ESTRUCTURAL_FEATURE__DERIVED | VARIABLE_NAME_MISMATCH
   oldChangeable | oldDerived | VARIABLE_NAME_MISMATCH
   newChangeable | newDerived | VARIABLE_NAME_MISMATCH

   6

       eNotify(new ENotificationImpl(this, Notification.SET, EcorePackage.ESTRUCTURAL_FEATURE__DERIVED, oldDerived, newDerived));

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