if (isInited) return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI); // Obtain or create and register package Ecore2EcorePackageImpl theEcore2EcorePackage = (Ecore2EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof Ecore2EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new Ecore2EcorePackageImpl()); isInited = true; // Initialize simple dependencies MappingPackage.eINSTANCE.eClass(); // Create package meta-data objects theEcore2EcorePackage.createPackageContents(); // Initialize created meta-data theEcore2EcorePackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theEcore2EcorePackage.freeze(); return theEcore2EcorePackage;
if (isInited) return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI); // Obtain or create and register package MappingPackageImpl theMappingPackage = (MappingPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof MappingPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new MappingPackageImpl()); isInited = true; // Initialize simple dependencies EcorePackage.eINSTANCE.eClass(); // Create package meta-data objects theMappingPackage.createPackageContents(); // Initialize created meta-data theMappingPackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theMappingPackage.freeze(); return theMappingPackage;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2ecore/impl/Ecore2EcorePackageImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingPackageImpl.java
Method name: Ecore2EcorePackage init() Method name: MappingPackage init()
Number of AST nodes: 9 Number of AST nodes: 9
1
if (isInited) return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
1
if (isInited) return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
2
    // Obtain or create and register package
2
    // Obtain or create and register package
3
    Ecore2EcorePackageImpl theEcore2EcorePackage = (Ecore2EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof Ecore2EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new Ecore2EcorePackageImpl());
3
    MappingPackageImpl theMappingPackage = (MappingPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof MappingPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new MappingPackageImpl());
4
    isInited = true;
4
    isInited = true;
5
    // Initialize simple dependencies
5
    // Initialize simple dependencies
6
    MappingPackage.eINSTANCE.eClass();
6
    EcorePackage.eINSTANCE.eClass();
7
    // Create package meta-data objects
7
    // Create package meta-data objects
8
    theEcore2EcorePackage.createPackageContents();
8
    theMappingPackage.createPackageContents();
9
    // Initialize created meta-data
9
    // Initialize created meta-data
10
    theEcore2EcorePackage.initializePackageContents();
10
    theMappingPackage.initializePackageContents();
11
    // Mark meta-data to indicate it can't be changed
11
    // Mark meta-data to indicate it can't be changed
12
    theEcore2EcorePackage.freeze();
12
    theMappingPackage.freeze();
13
    return theEcore2EcorePackage;
13
    return theMappingPackage;
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 comparisons29
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isInited)
    1
    if (isInited)
                                                                                                                                                                                      
    2
    return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
    Preondition Violations
    Unmatched return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
    2
    return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
    2
    return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
    2
    return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
    Preondition Violations
    Unmatched return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
                                                                                                                                                                                                      
    3
    Ecore2EcorePackageImpl theEcore2EcorePackage = (Ecore2EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof Ecore2EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new Ecore2EcorePackageImpl());
    3
    Ecore2EcorePackageImpl theEcore2EcorePackage = (Ecore2EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof Ecore2EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new Ecore2EcorePackageImpl());
    3
    MappingPackageImpl theMappingPackage = (MappingPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof MappingPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new MappingPackageImpl());
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplorg.eclipse.emf.mapping.impl.MappingPackageImplSUBCLASS_TYPE_MISMATCH
    theEcore2EcorePackagetheMappingPackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplorg.eclipse.emf.mapping.impl.MappingPackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplorg.eclipse.emf.mapping.impl.MappingPackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplorg.eclipse.emf.mapping.impl.MappingPackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplorg.eclipse.emf.mapping.impl.MappingPackageImplSUBCLASS_TYPE_MISMATCH
    3
    MappingPackageImpl theMappingPackage = (MappingPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof MappingPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new MappingPackageImpl());
    4
    isInited = true;
    4
    isInited = true;
    5
    MappingPackage.eINSTANCE.eClass();
    5
    MappingPackage.eINSTANCE.eClass();
    5
    EcorePackage.eINSTANCE.eClass();
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.MappingPackageorg.eclipse.emf.ecore.EcorePackageVARIABLE_TYPE_MISMATCH
    org.eclipse.emf.mapping.MappingPackageorg.eclipse.emf.ecore.EcorePackageVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
    • Make classes org.eclipse.emf.mapping.MappingPackage and org.eclipse.emf.ecore.EcorePackage extend a common superclass
    Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage.eINSTANCE does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage.eINSTANCE
    • Make classes org.eclipse.emf.mapping.MappingPackage and org.eclipse.emf.ecore.EcorePackage extend a common superclass
    5
    EcorePackage.eINSTANCE.eClass();
    6
    theEcore2EcorePackage.createPackageContents();
    6
    theEcore2EcorePackage.createPackageContents();
    6
    theMappingPackage.createPackageContents();
    Differences
    Expression1Expression2Difference
    theEcore2EcorePackagetheMappingPackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplorg.eclipse.emf.mapping.impl.MappingPackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theEcore2EcorePackage cannot be unified with expression theMappingPackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents()
    6
    theMappingPackage.createPackageContents();
    7
    theEcore2EcorePackage.initializePackageContents();
    7
    theEcore2EcorePackage.initializePackageContents();
    7
    theMappingPackage.initializePackageContents();
    Differences
    Expression1Expression2Difference
    theEcore2EcorePackagetheMappingPackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplorg.eclipse.emf.mapping.impl.MappingPackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theEcore2EcorePackage cannot be unified with expression theMappingPackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents()
    7
    theMappingPackage.initializePackageContents();
    8
    theEcore2EcorePackage.freeze();
    8
    theEcore2EcorePackage.freeze();
    8
    theMappingPackage.freeze();
    Differences
    Expression1Expression2Difference
    theEcore2EcorePackagetheMappingPackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplorg.eclipse.emf.mapping.impl.MappingPackageImplSUBCLASS_TYPE_MISMATCH
    8
    theMappingPackage.freeze();
    9
    return theEcore2EcorePackage;
    9
    return theEcore2EcorePackage;
    9
    return theMappingPackage;
    Differences
    Expression1Expression2Difference
    theEcore2EcorePackagetheMappingPackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplorg.eclipse.emf.mapping.impl.MappingPackageImplSUBCLASS_TYPE_MISMATCH
    9
    return theMappingPackage;
    Precondition Violations (6)
    Row Violation
    1Unmatched return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
    2Unmatched return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
    3Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage
    4Type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage.eINSTANCE does not match with type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage.eINSTANCE
    5Expression theEcore2EcorePackage cannot be unified with expression theMappingPackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents()
    6Expression theEcore2EcorePackage cannot be unified with expression theMappingPackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents()