if (genModelAnnotation != null) { GenAnnotation nestedGenAnnotation = genModelAnnotation.getGenAnnotation(GENANNOTATION_SOURCE_SELECTED_REFERENCES); if (nestedGenAnnotation != null) { changed |= genModelAnnotation.getGenAnnotations().remove(nestedGenAnnotation); } }
if (eObjectToExtensionMap != null) { AnyType anyType = eObjectToExtensionMap.get(object); if (anyType != null) { saveAttributeFeatureMap(anyType, XMLTypePackage.eINSTANCE.getAnyType_AnyAttribute()); } }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/exporter/ModelExporter.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
Method name: boolean saveExporter() Method name: void processAttributeExtensions(EObject)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (genModelAnnotation != null)
1
if (eObjectToExtensionMap != null)
2
      {
2
    {
3
        GenAnnotation nestedGenAnnotation = genModelAnnotation.getGenAnnotation(GENANNOTATION_SOURCE_SELECTED_REFERENCES);
3
      AnyType anyType = eObjectToExtensionMap.get(object);
4
        if (nestedGenAnnotation != null)
4
      if (anyType != null)
5
        {
5
      {
6
          changed |= genModelAnnotation.getGenAnnotations().remove(nestedGenAnnotation);
6
        saveAttributeFeatureMap(anyType, XMLTypePackage.eINSTANCE.getAnyType_AnyAttribute());
7
        }
7
      
8
  
8
}
9
    }
9
    }
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.2
Clones locationClones are in different classes
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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    36
    if (genModelAnnotation != null)
    36
    if (genModelAnnotation != null)
    1
    if (eObjectToExtensionMap != null)
    Differences
    Expression1Expression2Difference
    genModelAnnotationeObjectToExtensionMapVARIABLE_NAME_MISMATCH
    org.eclipse.emf.codegen.ecore.genmodel.GenAnnotationjava.util.MapVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation of variable genModelAnnotation does not match with type java.util.Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.xml.type.AnyType> of variable eObjectToExtensionMap
    • Make classes org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation and java.util.Map extend a common superclass
    1
    if (eObjectToExtensionMap != null)
                                                                                                              
    2
    AnyType anyType = eObjectToExtensionMap.get(object);
    37
    GenAnnotation nestedGenAnnotation = genModelAnnotation.getGenAnnotation(GENANNOTATION_SOURCE_SELECTED_REFERENCES);
                                                                                                                                                                                                                                            
    38
    if (nestedGenAnnotation != null)
    38
    if (nestedGenAnnotation != null)
    3
    if (anyType != null)
    Differences
    Expression1Expression2Difference
    nestedGenAnnotationanyTypeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.codegen.ecore.genmodel.GenAnnotationorg.eclipse.emf.ecore.xml.type.AnyTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation of variable nestedGenAnnotation does not match with type org.eclipse.emf.ecore.xml.type.AnyType of variable anyType
    • Make classes org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation and org.eclipse.emf.ecore.xml.type.AnyType extend a common superclass
    3
    if (anyType != null)
                                                                                                                                                                                  
    4
    saveAttributeFeatureMap(anyType, XMLTypePackage.eINSTANCE.getAnyType_AnyAttribute());
    39
    changed |= genModelAnnotation.getGenAnnotations().remove(nestedGenAnnotation);
                                                                                                                                                                    
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation of variable genModelAnnotation does not match with type java.util.Map<org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.xml.type.AnyType> of variable eObjectToExtensionMap
    2Type org.eclipse.emf.codegen.ecore.genmodel.GenAnnotation of variable nestedGenAnnotation does not match with type org.eclipse.emf.ecore.xml.type.AnyType of variable anyType