if (eGenericType == null && EcorePackage.Literals.EOBJECT.getInstanceTypeName().equals(typeName) && requiredClassifierType != RequiredClassifierType.DATA_TYPE) { eGenericType = EcoreFactory.eINSTANCE.createEGenericType(); eGenericType.setEClassifier(EcorePackage.Literals.EOBJECT); }
if (eGenericType == null && EcorePackage.Literals.EFEATURE_MAP.getInstanceTypeName().equals(typeName) && requiredClassifierType != RequiredClassifierType.CLASS) { eGenericType = EcoreFactory.eINSTANCE.createEGenericType(); eGenericType.setEClassifier(EcorePackage.Literals.EFEATURE_MAP_ENTRY); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/java/builder/JavaEcoreBuilder.java File path: /emf-2.4.1/src/org/eclipse/emf/importer/java/builder/JavaEcoreBuilder.java
Method name: EGenericType resolve(EModelElement, String, RequiredClassifierType, boolean) Method name: EGenericType resolve(EModelElement, String, RequiredClassifierType, boolean)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (eGenericType == null &&
1
if (eGenericType == null &&
2
          EcorePackage.Literals.EOBJECT.getInstanceTypeName().equals(typeName) &&
2
          EcorePackage.Literals.EFEATURE_MAP.getInstanceTypeName().equals(typeName) &&
3
          requiredClassifierType != RequiredClassifierType.DATA_TYPE)
3
          requiredClassifierType != RequiredClassifierType.CLASS)
4
    {
4
    {
5
      eGenericType = EcoreFactory.eINSTANCE.createEGenericType();
5
      eGenericType = EcoreFactory.eINSTANCE.createEGenericType();
6
      eGenericType.setEClassifier(EcorePackage.Literals.EOBJECT);
6
      eGenericType.setEClassifier(EcorePackage.Literals.EFEATURE_MAP_ENTRY);
7
    }
7
    }
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.5
Clones locationClones are in the same method
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    77
    if (eGenericType == null && EcorePackage.Literals.EOBJECT.getInstanceTypeName().equals(typeName) && requiredClassifierType != RequiredClassifierType.DATA_TYPE)
    77
    if (eGenericType == null && EcorePackage.Literals.EOBJECT.getInstanceTypeName().equals(typeName) && requiredClassifierType != RequiredClassifierType.DATA_TYPE)
    80
    if (eGenericType == null && EcorePackage.Literals.EFEATURE_MAP.getInstanceTypeName().equals(typeName) && requiredClassifierType != RequiredClassifierType.CLASS)
    Differences
    Expression1Expression2Difference
    EOBJECTEFEATURE_MAPVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EDataTypeVARIABLE_TYPE_MISMATCH
    DATA_TYPECLASSVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable EcorePackage.Literals.EOBJECT does not match with type org.eclipse.emf.ecore.EDataType of variable EcorePackage.Literals.EFEATURE_MAP
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EDataType extend a common superclass
    80
    if (eGenericType == null && EcorePackage.Literals.EFEATURE_MAP.getInstanceTypeName().equals(typeName) && requiredClassifierType != RequiredClassifierType.CLASS)
    78
    eGenericType = EcoreFactory.eINSTANCE.createEGenericType();
    81
    eGenericType = EcoreFactory.eINSTANCE.createEGenericType();
    79
    eGenericType.setEClassifier(EcorePackage.Literals.EOBJECT);
    79
    eGenericType.setEClassifier(EcorePackage.Literals.EOBJECT);
    82
    eGenericType.setEClassifier(EcorePackage.Literals.EFEATURE_MAP_ENTRY);
    Differences
    Expression1Expression2Difference
    EOBJECTEFEATURE_MAP_ENTRYVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EDataTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable EcorePackage.Literals.EOBJECT does not match with type org.eclipse.emf.ecore.EDataType of variable EcorePackage.Literals.EFEATURE_MAP_ENTRY
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EDataType extend a common superclass
    82
    eGenericType.setEClassifier(EcorePackage.Literals.EFEATURE_MAP_ENTRY);
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.ecore.EClass of variable EcorePackage.Literals.EOBJECT does not match with type org.eclipse.emf.ecore.EDataType of variable EcorePackage.Literals.EFEATURE_MAP
    2Type org.eclipse.emf.ecore.EClass of variable EcorePackage.Literals.EOBJECT does not match with type org.eclipse.emf.ecore.EDataType of variable EcorePackage.Literals.EFEATURE_MAP_ENTRY