String oldTargetNamespace = delegateXMLInfo.getTargetNamespace(); delegateXMLInfo.setTargetNamespace(newTargetNamespace); if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE, oldTargetNamespace, newTargetNamespace));
int oldXMLRepresentation = delegateXMLInfo.getXMLRepresentation(); delegateXMLInfo.setXMLRepresentation(newXMLRepresentation); if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION, oldXMLRepresentation, newXMLRepresentation));
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/impl/XMLInfoImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/impl/XMLInfoImpl.java
Method name: void setTargetNamespace(String) Method name: void setXMLRepresentation(int)
Number of AST nodes: 4 Number of AST nodes: 4
1
String oldTargetNamespace = delegateXMLInfo.getTargetNamespace();
1
int oldXMLRepresentation = delegateXMLInfo.getXMLRepresentation();
2
    delegateXMLInfo.setTargetNamespace(newTargetNamespace);
2
    delegateXMLInfo.setXMLRepresentation(newXMLRepresentation);
3
    if (eNotificationRequired())
3
    if (eNotificationRequired())
4
      eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE, oldTargetNamespace, newTargetNamespace));
4
      eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION, oldXMLRepresentation, newXMLRepresentation));
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 declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                          
    1
    int oldXMLRepresentation = delegateXMLInfo.getXMLRepresentation();
    1
    String oldTargetNamespace = delegateXMLInfo.getTargetNamespace();
                                                                                                                                        
                                                                                                                                
    2
    delegateXMLInfo.setXMLRepresentation(newXMLRepresentation);
    2
    delegateXMLInfo.setTargetNamespace(newTargetNamespace);
                                                                                                                        
    3
    if (eNotificationRequired())
    3
    if (eNotificationRequired())
    4
    eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE, oldTargetNamespace, newTargetNamespace));
    4
    eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE, oldTargetNamespace, newTargetNamespace));
    4
    eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION, oldXMLRepresentation, newXMLRepresentation));
    Differences
    Expression1Expression2Difference
    XML_INFO__TARGET_NAMESPACEXML_INFO__XML_REPRESENTATIONVARIABLE_NAME_MISMATCH
    oldTargetNamespaceoldXMLRepresentationVARIABLE_NAME_MISMATCH
    java.lang.StringintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable oldTargetNamespace does not match with type int of variable oldXMLRepresentation
    4
    eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__XML_REPRESENTATION, oldXMLRepresentation, newXMLRepresentation));
    Precondition Violations (1)
    Row Violation
    1Type java.lang.String of variable oldTargetNamespace does not match with type int of variable oldXMLRepresentation