String oldName = delegateXMLInfo.getName(); delegateXMLInfo.setName(newName); if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__NAME, oldName, newName));
String oldTargetNamespace = delegateXMLInfo.getTargetNamespace(); delegateXMLInfo.setTargetNamespace(newTargetNamespace); if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE, oldTargetNamespace, newTargetNamespace));
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 setName(String) Method name: void setTargetNamespace(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
String oldName = delegateXMLInfo.getName();
1
String oldTargetNamespace = delegateXMLInfo.getTargetNamespace();
2
    delegateXMLInfo.setName(newName);
2
    delegateXMLInfo.setTargetNamespace(newTargetNamespace);
3
    if (eNotificationRequired())
3
    if (eNotificationRequired())
4
      eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__NAME, oldName, newName));
4
      eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE, oldTargetNamespace, newTargetNamespace));
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 statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String oldName = delegateXMLInfo.getName();
    1
    String oldName = delegateXMLInfo.getName();
    1
    String oldTargetNamespace = delegateXMLInfo.getTargetNamespace();
    Differences
    Expression1Expression2Difference
    oldNameoldTargetNamespaceVARIABLE_NAME_MISMATCH
    getNamegetTargetNamespaceMETHOD_INVOCATION_NAME_MISMATCH
    1
    String oldTargetNamespace = delegateXMLInfo.getTargetNamespace();
    2
    delegateXMLInfo.setName(newName);
    2
    delegateXMLInfo.setName(newName);
    2
    delegateXMLInfo.setTargetNamespace(newTargetNamespace);
    Differences
    Expression1Expression2Difference
    setNamesetTargetNamespaceMETHOD_INVOCATION_NAME_MISMATCH
    newNamenewTargetNamespaceVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression delegateXMLInfo.setName(newName) is a void method call, and thus it cannot be parameterized
    Expression delegateXMLInfo.setTargetNamespace(newTargetNamespace) is a void method call, and thus it cannot be parameterized
    2
    delegateXMLInfo.setTargetNamespace(newTargetNamespace);
    3
    if (eNotificationRequired())
    3
    if (eNotificationRequired())
    4
    eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__NAME, oldName, newName));
    4
    eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__NAME, oldName, newName));
    4
    eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE, oldTargetNamespace, newTargetNamespace));
    Differences
    Expression1Expression2Difference
    XML_INFO__NAMEXML_INFO__TARGET_NAMESPACEVARIABLE_NAME_MISMATCH
    oldNameoldTargetNamespaceVARIABLE_NAME_MISMATCH
    newNamenewTargetNamespaceVARIABLE_NAME_MISMATCH
    4
    eNotify(new ENotificationImpl(this, Notification.SET, Ecore2XMLPackage.XML_INFO__TARGET_NAMESPACE, oldTargetNamespace, newTargetNamespace));
    Precondition Violations (2)
    Row Violation
    1Expression delegateXMLInfo.setName(newName) is a void method call, and thus it cannot be parameterized
    2Expression delegateXMLInfo.setTargetNamespace(newTargetNamespace) is a void method call, and thus it cannot be parameterized