if (isInited) return (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI); // Obtain or create and register package ChangePackageImpl theChangePackage = (ChangePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ChangePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ChangePackageImpl()); isInited = true; // Initialize simple dependencies EcorePackage.eINSTANCE.eClass(); // Create package meta-data objects theChangePackage.createPackageContents(); // Initialize created meta-data theChangePackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theChangePackage.freeze(); return theChangePackage;
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;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/impl/ChangePackageImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2ecore/impl/Ecore2EcorePackageImpl.java
Method name: ChangePackage init() Method name: Ecore2EcorePackage init()
Number of AST nodes: 9 Number of AST nodes: 9
1
if (isInited) return (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI);
1
if (isInited) return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
2

3
    // Obtain or create and register package
2
    // Obtain or create and register package
4
    ChangePackageImpl theChangePackage = (ChangePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ChangePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ChangePackageImpl());
3
    Ecore2EcorePackageImpl theEcore2EcorePackage = (Ecore2EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof Ecore2EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new Ecore2EcorePackageImpl());
5

6
    isInited = true;
4
    isInited = true;
7

8
    // Initialize simple dependencies
5
    // Initialize simple dependencies
9
    EcorePackage.eINSTANCE.eClass();
6
    MappingPackage.eINSTANCE.eClass();
10

11
    // Create package meta-data objects
7
    // Create package meta-data objects
12
    theChangePackage.createPackageContents();
8
    theEcore2EcorePackage.createPackageContents();
13

14
    // Initialize created meta-data
9
    // Initialize created meta-data
15
    theChangePackage.initializePackageContents();
10
    theEcore2EcorePackage.initializePackageContents();
16

17
    // Mark meta-data to indicate it can't be changed
11
    // Mark meta-data to indicate it can't be changed
18
    theChangePackage.freeze();
12
    theEcore2EcorePackage.freeze();
19

20
    return theChangePackage;
13
    return theEcore2EcorePackage;
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 statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)20.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isInited)
    1
    if (isInited)
    2
    return (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI);
    2
    return (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI);
    2
    return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.change.ChangePackageorg.eclipse.emf.mapping.ecore2ecore.Ecore2EcorePackageSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.ecore.change.ChangePackageorg.eclipse.emf.mapping.ecore2ecore.Ecore2EcorePackageSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI) cannot be unified with expression (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI) , because common superclass org.eclipse.emf.ecore.EPackage does not declare member(s) public static final java.lang.String eNS_URI
    Expression ChangePackage cannot be unified with expression Ecore2EcorePackage , because common superclass org.eclipse.emf.ecore.EPackage does not declare member(s) public static final java.lang.String eNS_URI
    2
    return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
    3
    ChangePackageImpl theChangePackage = (ChangePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ChangePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ChangePackageImpl());
    3
    ChangePackageImpl theChangePackage = (ChangePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ChangePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ChangePackageImpl());
    3
    Ecore2EcorePackageImpl theEcore2EcorePackage = (Ecore2EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof Ecore2EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new Ecore2EcorePackageImpl());
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.change.impl.ChangePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    theChangePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.change.impl.ChangePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.ecore.change.impl.ChangePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.ecore.change.impl.ChangePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.ecore.change.impl.ChangePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    3
    Ecore2EcorePackageImpl theEcore2EcorePackage = (Ecore2EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof Ecore2EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new Ecore2EcorePackageImpl());
    4
    isInited = true;
    4
    isInited = true;
    5
    EcorePackage.eINSTANCE.eClass();
    5
    EcorePackage.eINSTANCE.eClass();
    5
    MappingPackage.eINSTANCE.eClass();
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.EcorePackageorg.eclipse.emf.mapping.MappingPackageSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.ecore.EcorePackageorg.eclipse.emf.mapping.MappingPackageSUBCLASS_TYPE_MISMATCH
    5
    MappingPackage.eINSTANCE.eClass();
    6
    theChangePackage.createPackageContents();
    6
    theChangePackage.createPackageContents();
    6
    theEcore2EcorePackage.createPackageContents();
    Differences
    Expression1Expression2Difference
    theChangePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.change.impl.ChangePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theChangePackage cannot be unified with expression theEcore2EcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents()
    6
    theEcore2EcorePackage.createPackageContents();
    7
    theChangePackage.initializePackageContents();
    7
    theChangePackage.initializePackageContents();
    7
    theEcore2EcorePackage.initializePackageContents();
    Differences
    Expression1Expression2Difference
    theChangePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.change.impl.ChangePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theChangePackage cannot be unified with expression theEcore2EcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents()
    7
    theEcore2EcorePackage.initializePackageContents();
    8
    theChangePackage.freeze();
    8
    theChangePackage.freeze();
    8
    theEcore2EcorePackage.freeze();
    Differences
    Expression1Expression2Difference
    theChangePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.change.impl.ChangePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    8
    theEcore2EcorePackage.freeze();
    9
    return theChangePackage;
    9
    return theChangePackage;
    9
    return theEcore2EcorePackage;
    Differences
    Expression1Expression2Difference
    theChangePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.change.impl.ChangePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    9
    return theEcore2EcorePackage;
    Precondition Violations (4)
    Row Violation
    1Expression (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI) cannot be unified with expression (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI) , because common superclass org.eclipse.emf.ecore.EPackage does not declare member(s) public static final java.lang.String eNS_URI
    2Expression ChangePackage cannot be unified with expression Ecore2EcorePackage , because common superclass org.eclipse.emf.ecore.EPackage does not declare member(s) public static final java.lang.String eNS_URI
    3Expression theChangePackage cannot be unified with expression theEcore2EcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents()
    4Expression theChangePackage cannot be unified with expression theEcore2EcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents()