if (isInited) return (TreePackage)EPackage.Registry.INSTANCE.getEPackage(TreePackage.eNS_URI); // Obtain or create and register package TreePackageImpl theTreePackage = (TreePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof TreePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new TreePackageImpl()); isInited = true; // Initialize simple dependencies EcorePackage.eINSTANCE.eClass(); // Create package meta-data objects theTreePackage.createPackageContents(); // Initialize created meta-data theTreePackage.initializePackageContents(); // Mark meta-data to indicate it can't be changed theTreePackage.freeze(); return theTreePackage;
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/edit/tree/impl/TreePackageImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2ecore/impl/Ecore2EcorePackageImpl.java
Method name: TreePackage init() Method name: Ecore2EcorePackage init()
Number of AST nodes: 9 Number of AST nodes: 9
1
if (isInited) return (TreePackage)EPackage.Registry.INSTANCE.getEPackage(TreePackage.eNS_URI);
1
if (isInited) return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
2
    // Obtain or create and register package
2
    // Obtain or create and register package
3
    TreePackageImpl theTreePackage = (TreePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof TreePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new TreePackageImpl());
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
    // Initialize simple dependencies
5
    // Initialize simple dependencies
6
    EcorePackage.eINSTANCE.eClass();
6
    MappingPackage.eINSTANCE.eClass();
7
    // Create package meta-data objects
7
    // Create package meta-data objects
8
    theTreePackage.createPackageContents();
8
    theEcore2EcorePackage.createPackageContents();
9
    // Initialize created meta-data
9
    // Initialize created meta-data
10
    theTreePackage.initializePackageContents();
10
    theEcore2EcorePackage.initializePackageContents();
11
    // Mark meta-data to indicate it can't be changed
11
    // Mark meta-data to indicate it can't be changed
12
    theTreePackage.freeze();
12
    theEcore2EcorePackage.freeze();
13
    return theTreePackage;
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 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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isInited)
    1
    if (isInited)
                                                                                                                                                                                                      
    2
    return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
    Preondition Violations
    Unmatched return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
    2
    return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
    2
    return (TreePackage)EPackage.Registry.INSTANCE.getEPackage(TreePackage.eNS_URI);
    2
    return (TreePackage)EPackage.Registry.INSTANCE.getEPackage(TreePackage.eNS_URI);
    Preondition Violations
    Unmatched return (TreePackage)EPackage.Registry.INSTANCE.getEPackage(TreePackage.eNS_URI);
                                                                                                                                                                          
    3
    TreePackageImpl theTreePackage = (TreePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof TreePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new TreePackageImpl());
    3
    TreePackageImpl theTreePackage = (TreePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof TreePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new TreePackageImpl());
    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.edit.tree.impl.TreePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    theTreePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.edit.tree.impl.TreePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.edit.tree.impl.TreePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.edit.tree.impl.TreePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.edit.tree.impl.TreePackageImplorg.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.MappingPackageVARIABLE_TYPE_MISMATCH
    org.eclipse.emf.ecore.EcorePackageorg.eclipse.emf.mapping.MappingPackageVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    • Make classes org.eclipse.emf.ecore.EcorePackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage.eINSTANCE does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage.eINSTANCE
    • Make classes org.eclipse.emf.ecore.EcorePackage and org.eclipse.emf.mapping.MappingPackage extend a common superclass
    5
    MappingPackage.eINSTANCE.eClass();
    6
    theTreePackage.createPackageContents();
    6
    theTreePackage.createPackageContents();
    6
    theEcore2EcorePackage.createPackageContents();
    Differences
    Expression1Expression2Difference
    theTreePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.edit.tree.impl.TreePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theTreePackage 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
    theTreePackage.initializePackageContents();
    7
    theTreePackage.initializePackageContents();
    7
    theEcore2EcorePackage.initializePackageContents();
    Differences
    Expression1Expression2Difference
    theTreePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.edit.tree.impl.TreePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theTreePackage 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
    theTreePackage.freeze();
    8
    theTreePackage.freeze();
    8
    theEcore2EcorePackage.freeze();
    Differences
    Expression1Expression2Difference
    theTreePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.edit.tree.impl.TreePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    8
    theEcore2EcorePackage.freeze();
    9
    return theTreePackage;
    9
    return theTreePackage;
    9
    return theEcore2EcorePackage;
    Differences
    Expression1Expression2Difference
    theTreePackagetheEcore2EcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.edit.tree.impl.TreePackageImplorg.eclipse.emf.mapping.ecore2ecore.impl.Ecore2EcorePackageImplSUBCLASS_TYPE_MISMATCH
    9
    return theEcore2EcorePackage;
    Precondition Violations (6)
    Row Violation
    1Unmatched return (Ecore2EcorePackage)EPackage.Registry.INSTANCE.getEPackage(Ecore2EcorePackage.eNS_URI);
    2Unmatched return (TreePackage)EPackage.Registry.INSTANCE.getEPackage(TreePackage.eNS_URI);
    3Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage
    4Type org.eclipse.emf.ecore.EcorePackage of variable EcorePackage.eINSTANCE does not match with type org.eclipse.emf.mapping.MappingPackage of variable MappingPackage.eINSTANCE
    5Expression theTreePackage cannot be unified with expression theEcore2EcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents()
    6Expression theTreePackage cannot be unified with expression theEcore2EcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents()