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();
EParameter eParameter = (EParameter)object; StringBuffer result = new StringBuffer(); result.append(eParameter.getName()); if (eParameter.getEGenericType() != null) { result.append(" : "); result.append(EGenericTypeItemProvider.getText(eParameter.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/EParameterItemProvider.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
EParameter eParameter = (EParameter)object;
2
    StringBuffer result = new StringBuffer();
2
    StringBuffer result = new StringBuffer();
3
    result.append(eReference.getName());
3
    result.append(eParameter.getName());
4
    if (eReference.getEGenericType() != null)
4
    if (eParameter.getEGenericType() != null)
5
    {
5
    {
6
      result.append(" : ");
6
      result.append(" : ");
7
      result.append(EGenericTypeItemProvider.getText(eReference.getEGenericType()));
7
      result.append(EGenericTypeItemProvider.getText(eParameter.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
    EParameter eParameter = (EParameter)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(eParameter.getName());
    Differences
    Expression1Expression2Difference
    eReferenceeParameterVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EParameterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EParameter of variable eParameter
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EParameter extend a common superclass
    3
    result.append(eParameter.getName());
    4
    if (eReference.getEGenericType() != null)
    4
    if (eReference.getEGenericType() != null)
    4
    if (eParameter.getEGenericType() != null)
    Differences
    Expression1Expression2Difference
    eReferenceeParameterVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EParameterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EParameter of variable eParameter
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EParameter extend a common superclass
    4
    if (eParameter.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(eParameter.getEGenericType()));
    Differences
    Expression1Expression2Difference
    eReferenceeParameterVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EParameterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EParameter of variable eParameter
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EParameter extend a common superclass
    6
    result.append(EGenericTypeItemProvider.getText(eParameter.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.EParameter of variable eParameter
    2Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EParameter of variable eParameter
    3Type org.eclipse.emf.ecore.EReference of variable eReference does not match with type org.eclipse.emf.ecore.EParameter of variable eParameter