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; | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 27 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 9.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (isInited) | 1 | if (isInited) | ||||||||||||||||||||||||||
|
| 2 | return (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); | ||||||||||||||||||||||||||
2 | 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 | 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 | theEcorePackage.createPackageContents(); | |||||||||||||||||||||||||
6 | theXMLTypePackage.initializePackageContents(); |
| 6 | theEcorePackage.initializePackageContents(); | |||||||||||||||||||||||||
7 | EValidator.Registry.INSTANCE.put(theXMLTypePackage, new EValidator.Descriptor() {...}); |
| 7 | EValidator.Registry.INSTANCE.put(theEcorePackage, new EValidator.Descriptor() {...}); | |||||||||||||||||||||||||
8 | theXMLTypePackage.freeze(); | | |||||||||||||||||||||||||||
9 | return theXMLTypePackage; |
| 8 | return theEcorePackage; |
Row | Violation |
---|---|
1 | Unmatched return (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); |
2 | Unmatched return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); |
3 | 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() |
4 | 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() |
5 | Clone fragment #1 returns variables theXMLTypePackage , while Clone fragment #2 returns variables |