EReference eReference = (EReference)object; StringBuffer result = new StringBuffer(); result.append(eReference.getName()); if (eReference.getEGenericType() != null) { result.append(" : "); result.append(EGenericTypeItemProvider.getText(eReference.getEGenericType())); } return result.toString();
EAttribute eAttribute = (EAttribute)object; StringBuffer result = new StringBuffer(); result.append(eAttribute.getName()); if (eAttribute.getEGenericType() != null) { result.append(" : "); result.append(EGenericTypeItemProvider.getText(eAttribute.getEGenericType())); } return result.toString();
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EReferenceItemProvider.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EAttributeItemProvider.java
Method name: String getText(Object) Method name: String getText(Object)
Number of AST nodes: 7 Number of AST nodes: 7
1
EReference eReference = (EReference)object;
1
EAttribute eAttribute = (EAttribute)object;
2
    StringBuffer result = new StringBuffer();
2
    StringBuffer result = new StringBuffer();
3
    result.append(eReference.getName());
3
    result.append(eAttribute.getName());
4
    if (eReference.getEGenericType() != null)
4
    if (eAttribute.getEGenericType() != null)
5
    {
5
    {
6
      result.append(" : ");
6
      result.append(" : ");
7
      result.append(EGenericTypeItemProvider.getText(eReference.getEGenericType()));
7
      result.append(EGenericTypeItemProvider.getText(eAttribute.getEGenericType()));
8
    }
8
    }
9
    return result.toString();
9
    return result.toString();
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 comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                            
    1
    EAttribute eAttribute = (EAttribute)object;
    1
    EReference eReference = (EReference)object;
                                                                                            
    2
    StringBuffer result = new StringBuffer();
    2
    StringBuffer result = new StringBuffer();
    3
    result.append(eReference.getName());
    3
    result.append(eReference.getName());
    3
    result.append(eAttribute.getName());
    Differences
    Expression1Expression2Difference
    eReferenceeAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EAttribute extend a common superclass
    3
    result.append(eAttribute.getName());
    4
    if (eReference.getEGenericType() != null)
    4
    if (eReference.getEGenericType() != null)
    4
    if (eAttribute.getEGenericType() != null)
    Differences
    Expression1Expression2Difference
    eReferenceeAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EAttribute extend a common superclass
    4
    if (eAttribute.getEGenericType() != null)
    5
    result.append(" : ");
    5
    result.append(" : ");
    6
    result.append(EGenericTypeItemProvider.getText(eReference.getEGenericType()));
    6
    result.append(EGenericTypeItemProvider.getText(eReference.getEGenericType()));
    6
    result.append(EGenericTypeItemProvider.getText(eAttribute.getEGenericType()));
    Differences
    Expression1Expression2Difference
    eReferenceeAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EAttribute extend a common superclass
    6
    result.append(EGenericTypeItemProvider.getText(eAttribute.getEGenericType()));
    7
    return result.toString();
    7
    return result.toString();
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    2Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    3Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute