if (isInited) return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); // Obtain or create and register package XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof XMLTypePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new XMLTypePackageImpl()); isInited = true; // Create package meta-data objects theXMLTypePackage.createPackageContents(); // Initialize created meta-data theXMLTypePackage.initializePackageContents(); // Register package validator EValidator.Registry.INSTANCE.put (theXMLTypePackage, new EValidator.Descriptor() { public EValidator getEValidator() { return XMLTypeValidator.INSTANCE; } }); // Mark meta-data to indicate it can't be changed theXMLTypePackage.freeze(); return theXMLTypePackage;
if (isInited) return (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); // Obtain or create and register package EcorePackageImpl theEcorePackage = (EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new EcorePackageImpl()); isInited = true; // Create package meta-data objects theEcorePackage.createPackageContents(); // Initialize created meta-data theEcorePackage.initializePackageContents(); // Register package validator EValidator.Registry.INSTANCE.put (theEcorePackage, new EValidator.Descriptor() { public EValidator getEValidator() { return EcoreValidator.INSTANCE; } }); return theEcorePackage;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/impl/XMLTypePackageImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java
Method name: XMLTypePackage init() Method name: EcorePackage init()
Number of AST nodes: 9 Number of AST nodes: 8
1
if (isInited) return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
1
if (isInited) return (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
2
    // Obtain or create and register package
2
    // Obtain or create and register package
3
    XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof XMLTypePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new XMLTypePackageImpl());
3
    EcorePackageImpl theEcorePackage = (EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new EcorePackageImpl());
4
    isInited = true;
4
    isInited = true;
5
    // Create package meta-data objects
5
    // Create package meta-data objects
6
    theXMLTypePackage.createPackageContents();
6
    theEcorePackage.createPackageContents();
7
    // Initialize created meta-data
7
    // Initialize created meta-data
8
    theXMLTypePackage.initializePackageContents();
8
    theEcorePackage.initializePackageContents();
9
    // Register package validator
9
    // Register package validator
10
    EValidator.Registry.INSTANCE.put
10
    EValidator.Registry.INSTANCE.put
11
      (theXMLTypePackage, 
11
      (theEcorePackage, 
12
       new EValidator.Descriptor()
12
       new EValidator.Descriptor()
13
       {
13
       {
14
         public EValidator getEValidator()
14
         public EValidator getEValidator()
15
         {
15
         {
16
           return XMLTypeValidator.INSTANCE;
16
           return EcoreValidator.INSTANCE;
17
         }
17
         }
18
       });
18
       });
19
    // Mark meta-data to indicate it can't be changed
19
    
20
    theXMLTypePackage.freeze();
21
    return theXMLTypePackage;
20
return theEcorePackage;
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 comparisons27
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)9.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (isInited)
    1
    if (isInited)
                                                                                                                                                                              
    2
    return (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
    Preondition Violations
    Unmatched return (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
    2
    return (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
    2
    return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
    2
    return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
    Preondition Violations
    Unmatched return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
                                                                                                                                                                                      
    3
    XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof XMLTypePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new XMLTypePackageImpl());
    3
    XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof XMLTypePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new XMLTypePackageImpl());
    3
    EcorePackageImpl theEcorePackage = (EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new EcorePackageImpl());
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImplorg.eclipse.emf.ecore.impl.EcorePackageImplSUBCLASS_TYPE_MISMATCH
    theXMLTypePackagetheEcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImplorg.eclipse.emf.ecore.impl.EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImplorg.eclipse.emf.ecore.impl.EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImplorg.eclipse.emf.ecore.impl.EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImplorg.eclipse.emf.ecore.impl.EcorePackageImplSUBCLASS_TYPE_MISMATCH
    3
    EcorePackageImpl theEcorePackage = (EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new EcorePackageImpl());
    4
    isInited = true;
    4
    isInited = true;
    5
    theXMLTypePackage.createPackageContents();
    5
    theXMLTypePackage.createPackageContents();
    5
    theEcorePackage.createPackageContents();
    Differences
    Expression1Expression2Difference
    theXMLTypePackagetheEcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImplorg.eclipse.emf.ecore.impl.EcorePackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theXMLTypePackage cannot be unified with expression theEcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents()
    5
    theEcorePackage.createPackageContents();
    6
    theXMLTypePackage.initializePackageContents();
    6
    theXMLTypePackage.initializePackageContents();
    6
    theEcorePackage.initializePackageContents();
    Differences
    Expression1Expression2Difference
    theXMLTypePackagetheEcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImplorg.eclipse.emf.ecore.impl.EcorePackageImplSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression theXMLTypePackage cannot be unified with expression theEcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents()
    6
    theEcorePackage.initializePackageContents();
    7
    EValidator.Registry.INSTANCE.put(theXMLTypePackage, new EValidator.Descriptor() {...});
    7
    EValidator.Registry.INSTANCE.put(theXMLTypePackage, new EValidator.Descriptor() {...});
    7
    EValidator.Registry.INSTANCE.put(theEcorePackage, new EValidator.Descriptor() {...});
    Differences
    Expression1Expression2Difference
    theXMLTypePackagetheEcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImplorg.eclipse.emf.ecore.impl.EcorePackageImplSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.ecore.xml.type.util.XMLTypeValidatororg.eclipse.emf.ecore.util.EcoreValidatorSUBCLASS_TYPE_MISMATCH
    7
    EValidator.Registry.INSTANCE.put(theEcorePackage, new EValidator.Descriptor() {...});
    8
    theXMLTypePackage.freeze();
                                                                
    9
    return theXMLTypePackage;
    9
    return theXMLTypePackage;
    8
    return theEcorePackage;
    Differences
    Expression1Expression2Difference
    theXMLTypePackagetheEcorePackageVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.xml.type.impl.XMLTypePackageImplorg.eclipse.emf.ecore.impl.EcorePackageImplSUBCLASS_TYPE_MISMATCH
    8
    return theEcorePackage;
    Precondition Violations (5)
    Row Violation
    1Unmatched return (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
    2Unmatched return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
    3Expression theXMLTypePackage cannot be unified with expression theEcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents()
    4Expression theXMLTypePackage cannot be unified with expression theEcorePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents()
    5Clone fragment #1 returns variables theXMLTypePackage , while Clone fragment #2 returns variables