157-2-4

updateChildren(notification); switch (notification.getFeatureID(EPackage.class)) { case EcorePackage.EPACKAGE__NS_URI: case EcorePackage.EPACKAGE__NS_PREFIX: case EcorePackage.EPACKAGE__EFACTORY_INSTANCE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case EcorePackage.EPACKAGE__ECLASSIFIERS: case EcorePackage.EPACKAGE__ESUBPACKAGES: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification);
updateChildren(notification); switch (notification.getFeatureID(EClassifier.class)) { case EcorePackage.ECLASSIFIER__INSTANCE_CLASS_NAME: case EcorePackage.ECLASSIFIER__DEFAULT_VALUE: case EcorePackage.ECLASSIFIER__INSTANCE_TYPE_NAME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case EcorePackage.ECLASSIFIER__ETYPE_PARAMETERS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification);

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EPackageItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EClassifierItemProvider.java
Method name: `void notifyChanged(Notification)` |  | Method name: `void notifyChanged(Notification)`
Number of AST nodes: 12 |  | Number of AST nodes: 11

1

    updateChildren(notification);↵

1

    updateChildren(notification);↵

2

        switch (notification.getFeatureID(EPackage.class))↵

2

        switch (notification.getFeatureID(EClassifier.class))↵

3

        {↵

3

        {↵

4

          case EcorePackage.EPACKAGE__NS_URI:↵

4

          case EcorePackage.ECLASSIFIER__INSTANCE_CLASS_NAME:↵

5

          case EcorePackage.EPACKAGE__NS_PREFIX:↵

5

          case EcorePackage.ECLASSIFIER__DEFAULT_VALUE:↵

6

          case EcorePackage.EPACKAGE__EFACTORY_INSTANCE:↵

6

          case EcorePackage.ECLASSIFIER__INSTANCE_TYPE_NAME:↵

7

            fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));↵

7

            fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));↵

8

            return;↵

8

            return;↵

9

          case EcorePackage.EPACKAGE__ECLASSIFIERS:↵

9

          case EcorePackage.E↵

10

          case EcorePackage.EPACKAGE__ESUBPACKAGES:↵

10

    CLASSIFIER__ETYPE_PARAMETERS:↵

11

            fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));↵

11

            fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));↵

12

            return;↵

12

            return;↵

13

        }↵

13

        }↵

14

        super.notifyChanged(notification);

14

        super.notifyChanged(notification);

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.2
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 47

1. {Refactorable}

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

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

   1

       updateChildren(notification);

   1

       updateChildren(notification);

   2

       switch (notification.getFeatureID(EPackage.class))

   2

       switch (notification.getFeatureID(EClassifier.class))

   3

       case EcorePackage.EPACKAGE__NS_URI:

   3 | case EcorePackage.EPACKAGE__NS_URI:
   3 | case EcorePackage.ECLASSIFIER__INSTANCE_CLASS_NAME:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EPACKAGE__NS_URI | ECLASSIFIER__INSTANCE_CLASS_NAME | VARIABLE_NAME_MISMATCH

   3

       case EcorePackage.ECLASSIFIER__INSTANCE_CLASS_NAME:

   4

       case EcorePackage.EPACKAGE__NS_PREFIX:

   4 | case EcorePackage.EPACKAGE__NS_PREFIX:
   4 | case EcorePackage.ECLASSIFIER__DEFAULT_VALUE:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EPACKAGE__NS_PREFIX | ECLASSIFIER__DEFAULT_VALUE | VARIABLE_NAME_MISMATCH

   4

       case EcorePackage.ECLASSIFIER__DEFAULT_VALUE:

   5

       case EcorePackage.EPACKAGE__EFACTORY_INSTANCE:

   5 | case EcorePackage.EPACKAGE__EFACTORY_INSTANCE:
   5 | case EcorePackage.ECLASSIFIER__INSTANCE_TYPE_NAME:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EPACKAGE__EFACTORY_INSTANCE | ECLASSIFIER__INSTANCE_TYPE_NAME | VARIABLE_NAME_MISMATCH

   5

       case EcorePackage.ECLASSIFIER__INSTANCE_TYPE_NAME:

   6

       fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));

   6

       fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));

   7

       return;

   7

       return;

   8

       case EcorePackage.EPACKAGE__ECLASSIFIERS:

   8 | case EcorePackage.EPACKAGE__ECLASSIFIERS:
   8 | case EcorePackage.ECLASSIFIER__ETYPE_PARAMETERS:

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   EPACKAGE__ECLASSIFIERS | ECLASSIFIER__ETYPE_PARAMETERS | VARIABLE_NAME_MISMATCH

   8

       case EcorePackage.ECLASSIFIER__ETYPE_PARAMETERS:

   9

       case EcorePackage.EPACKAGE__ESUBPACKAGES:

   10

       fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));

   9

       fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));

   11

       return;

   10

       return;

   12

       super.notifyChanged(notification);

   11

       super.notifyChanged(notification);

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