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;
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;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/impl/MappingPackageImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/impl/ChangePackageImpl.java
Method name: MappingPackage init() Method name: ChangePackage init()
Number of AST nodes: 9 Number of AST nodes: 9
1
if (isInited) return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
1
if (isInited) return (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI);
2

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

4
    isInited = true;
6
    isInited = true;
7

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

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

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

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

13
    return theMappingPackage;
20
    return theChangePackage;
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 (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI);
    Preondition Violations
    Unmatched return (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI);
    2
    return (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI);
    2
    return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
    2
    return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
    Preondition Violations
    Unmatched return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
                                                                                                                                                                                      
    3
    MappingPackageImpl theMappingPackage = (MappingPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof MappingPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new MappingPackageImpl());
    3
    MappingPackageImpl theMappingPackage = (MappingPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof MappingPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new MappingPackageImpl());
    3
    ChangePackageImpl theChangePackage = (ChangePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ChangePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ChangePackageImpl());
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.mapping.impl.MappingPackageImplorg.eclipse.emf.ecore.change.impl.ChangePackageImplSUBCLASS_TYPE_MISMATCH
    theMappingPackagetheChangePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.impl.MappingPackageImplorg.eclipse.emf.ecore.change.impl.ChangePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.mapping.impl.MappingPackageImplorg.eclipse.emf.ecore.change.impl.ChangePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.mapping.impl.MappingPackageImplorg.eclipse.emf.ecore.change.impl.ChangePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.mapping.impl.MappingPackageImplorg.eclipse.emf.ecore.change.impl.ChangePackageImplSUBCLASS_TYPE_MISMATCH
    3
    ChangePackageImpl theChangePackage = (ChangePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof ChangePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new ChangePackageImpl());
    4
    isInited = true;
    4
    isInited = true;
    5
    EcorePackage.eINSTANCE.eClass();
    5
    EcorePackage.eINSTANCE.eClass();
    6
    theMappingPackage.createPackageContents();
    6
    theMappingPackage.createPackageContents();
    6
    theChangePackage.createPackageContents();
    Differences
    Expression1Expression2Difference
    theMappingPackagetheChangePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.impl.MappingPackageImplorg.eclipse.emf.ecore.change.impl.ChangePackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theMappingPackage cannot be unified with expression theChangePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents()
    6
    theChangePackage.createPackageContents();
    7
    theMappingPackage.initializePackageContents();
    7
    theMappingPackage.initializePackageContents();
    7
    theChangePackage.initializePackageContents();
    Differences
    Expression1Expression2Difference
    theMappingPackagetheChangePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.impl.MappingPackageImplorg.eclipse.emf.ecore.change.impl.ChangePackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theMappingPackage cannot be unified with expression theChangePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents()
    7
    theChangePackage.initializePackageContents();
    8
    theMappingPackage.freeze();
    8
    theMappingPackage.freeze();
    8
    theChangePackage.freeze();
    Differences
    Expression1Expression2Difference
    theMappingPackagetheChangePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.impl.MappingPackageImplorg.eclipse.emf.ecore.change.impl.ChangePackageImplSUBCLASS_TYPE_MISMATCH
    8
    theChangePackage.freeze();
    9
    return theMappingPackage;
    9
    return theMappingPackage;
    9
    return theChangePackage;
    Differences
    Expression1Expression2Difference
    theMappingPackagetheChangePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.mapping.impl.MappingPackageImplorg.eclipse.emf.ecore.change.impl.ChangePackageImplSUBCLASS_TYPE_MISMATCH
    9
    return theChangePackage;
    Precondition Violations (4)
    Row Violation
    1Unmatched return (ChangePackage)EPackage.Registry.INSTANCE.getEPackage(ChangePackage.eNS_URI);
    2Unmatched return (MappingPackage)EPackage.Registry.INSTANCE.getEPackage(MappingPackage.eNS_URI);
    3Expression theMappingPackage cannot be unified with expression theChangePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents()
    4Expression theMappingPackage cannot be unified with expression theChangePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents()