updateChildren(notification); switch (notification.getFeatureID(EAnnotation.class)) { case EcorePackage.EANNOTATION__SOURCE: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case EcorePackage.EANNOTATION__DETAILS: case EcorePackage.EANNOTATION__CONTENTS: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification);
updateChildren(notification); switch (notification.getFeatureID(XMLMap.class)) { case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO: 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/EAnnotationItemProvider.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/provider/XMLMapItemProvider.java
Method name: void notifyChanged(Notification) Method name: void notifyChanged(Notification)
Number of AST nodes: 10 Number of AST nodes: 9
1
updateChildren(notification);
1
updateChildren(notification);
2
    switch (notification.getFeatureID(EAnnotation.class))
2
    switch (notification.getFeatureID(XMLMap.class))
3
    {
3
    {
4
      case EcorePackage.EANNOTATION__SOURCE:
4
      case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
5
        fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
5
        fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
6
        return;
6
        return;
7
      case EcorePackage.EANNOTATION__DETAILS:
7
      case Ecore2XMLPackage.
8
      case EcorePackage.EANNOTATION__CONTENTS:
8
XML_MAP__ECORE_TO_XML_INFO:
9
        fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
9
        fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
10
        return;
10
        return;
11
    }
11
    }
12
    super.notifyChanged(notification);
12
    super.notifyChanged(notification);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons32
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    updateChildren(notification);
    1
    updateChildren(notification);
    2
    switch (notification.getFeatureID(EAnnotation.class))
    2
    switch (notification.getFeatureID(XMLMap.class))
    3
    case EcorePackage.EANNOTATION__SOURCE:
    3
    case EcorePackage.EANNOTATION__SOURCE:
    3
    case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EcorePackageorg.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageVARIABLE_TYPE_MISMATCH
    EANNOTATION__SOURCEXML_MAP__ID_ATTRIBUTE_NAMEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    • Make classes org.eclipse.emf.ecore.EcorePackage and org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage extend a common superclass
    3
    case Ecore2XMLPackage.XML_MAP__ID_ATTRIBUTE_NAME:
    4
    fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
    4
    fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
    5
    return;
    5
    return;
    6
    case EcorePackage.EANNOTATION__DETAILS:
    6
    case EcorePackage.EANNOTATION__DETAILS:
    6
    case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EcorePackageorg.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackageVARIABLE_TYPE_MISMATCH
    EANNOTATION__DETAILSXML_MAP__ECORE_TO_XML_INFOVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    • Make classes org.eclipse.emf.ecore.EcorePackage and org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage extend a common superclass
    6
    case Ecore2XMLPackage.XML_MAP__ECORE_TO_XML_INFO:
    7
    case EcorePackage.EANNOTATION__CONTENTS:
                                                                                          
    8
    fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
    7
    fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
    9
    return;
    8
    return;
    10
    super.notifyChanged(notification);
    9
    super.notifyChanged(notification);
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage
    2Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage of variable Ecore2XMLPackage