EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); if (getFeatureKind(eStructuralFeature) == ExtendedMetaData.SIMPLE_FEATURE) { return eStructuralFeature; }
EAttribute eAttribute = eAllAttributes.get(i); if (getFeatureKind(eAttribute) == ExtendedMetaData.ELEMENT_WILDCARD_FEATURE) { return eAttribute; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
Method name: EStructuralFeature getSimpleFeature(EClass) Method name: EAttribute getMixedFeature(EClass)
Number of AST nodes: 3 Number of AST nodes: 3
1
EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
1
EAttribute eAttribute = eAllAttributes.get(i);
2
        if (getFeatureKind(eStructuralFeature) == ExtendedMetaData.SIMPLE_FEATURE)
2
          if (getFeatureKind(eAttribute) == ExtendedMetaData.ELEMENT_WILDCARD_FEATURE)
3
        {
3
          {
4
          return eStructuralFeature;
4
            return eAttribute;
5
        }
5
          }
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.4
Clones locationClones are declared in the same class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)9.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
    3
    EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
    Preondition Violations
    Unmatched statement EStructuralFeature eStructuralFeature=eClass.getEStructuralFeature(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                      
                                                                                                  
    6
    EAttribute eAttribute = eAllAttributes.get(i);
    Preondition Violations
    Unmatched statement EAttribute eAttribute=eAllAttributes.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    EAttribute eAttribute = eAllAttributes.get(i);
    4
    if (getFeatureKind(eStructuralFeature) == ExtendedMetaData.SIMPLE_FEATURE)
    4
    if (getFeatureKind(eStructuralFeature) == ExtendedMetaData.SIMPLE_FEATURE)
    7
    if (getFeatureKind(eAttribute) == ExtendedMetaData.ELEMENT_WILDCARD_FEATURE)
    Differences
    Expression1Expression2Difference
    eStructuralFeatureeAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EStructuralFeatureorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    SIMPLE_FEATUREELEMENT_WILDCARD_FEATUREVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EStructuralFeature of variable eStructuralFeature does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EStructuralFeature and org.eclipse.emf.ecore.EAttribute extend a common superclass
    7
    if (getFeatureKind(eAttribute) == ExtendedMetaData.ELEMENT_WILDCARD_FEATURE)
    5
    return eStructuralFeature;
    5
    return eStructuralFeature;
    Preondition Violations
    Unmatched return eStructuralFeature;
                                                              
                                              
    8
    return eAttribute;
    Preondition Violations
    Unmatched return eAttribute;
    8
    return eAttribute;
    Precondition Violations (5)
    Row Violation
    1Unmatched statement EStructuralFeature eStructuralFeature=eClass.getEStructuralFeature(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement EAttribute eAttribute=eAllAttributes.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Type org.eclipse.emf.ecore.EStructuralFeature of variable eStructuralFeature does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    4Unmatched return eStructuralFeature;
    5Unmatched return eAttribute;