File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/namespace/impl/XMLNamespacePackageImpl.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/impl/XMLTypePackageImpl.java | |||
Method name: XMLNamespacePackage init()
|
Method name: XMLTypePackage init()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 9 | |||
1 | if (isInited) return (XMLNamespacePackage)EPackage.Registry.INSTANCE.getEPackage(XMLNamespacePackage.eNS_URI);↵ | 1 | if (isInited) return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);↵ | |
2 | // Obtain or create and register package↵ | 2 | // Obtain or create and register package↵ | |
3 | XMLNamespacePackageImpl theXMLNamespacePackage = (XMLNamespacePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof XMLNamespacePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new XMLNamespacePackageImpl());↵ | 3 | XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof XMLTypePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new XMLTypePackageImpl());↵ | |
4 | isInited = true;↵ | 4 | isInited = true;↵ | |
5 | // Initialize simple dependencies↵ | |||
6 | XMLTypePackage.eINSTANCE.eClass();↵ | |||
7 | // Create package meta-data objects↵ | 5 | // Create package meta-data objects↵ | |
8 | theXMLNamespacePackage.createPackageContents();↵ | 6 | theXMLTypePackage.createPackageContents();↵ | |
9 | // Initialize created meta-data↵ | 7 | // Initialize created meta-data↵ | |
10 | theXMLNamespacePackage.initializePackageContents();↵ | 8 | theXMLTypePackage.initializePackageContents();↵ | |
11 | // Register package validator↵ | 9 | // Register package validator↵ | |
12 | EValidator.Registry.INSTANCE.put↵ | 10 | EValidator.Registry.INSTANCE.put↵ | |
13 | (theXMLNamespacePackage, ↵ | 11 | (theXMLTypePackage, ↵ | |
14 | new EValidator.Descriptor()↵ | 12 | new EValidator.Descriptor()↵ | |
15 | {↵ | 13 | {↵ | |
16 | public EValidator getEValidator()↵ | 14 | public EValidator getEValidator()↵ | |
17 | {↵ | 15 | {↵ | |
18 | return XMLNamespaceValidator.INSTANCE;↵ | 16 | return XMLTypeValidator.INSTANCE;↵ | |
19 | }↵ | 17 | }↵ | |
20 | });↵ | 18 | });↵ | |
21 | // Mark meta-data to indicate it can't be changed↵ | 19 | // Mark meta-data to indicate it can't be changed↵ | |
22 | theXMLNamespacePackage.freeze();↵ | 20 | theXMLTypePackage.freeze();↵ | |
23 | return theXMLNamespacePackage; | 21 | return theXMLTypePackage; | |
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 | 31 |
Number of mapped statements | 8 |
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) | 7.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (isInited) | 1 | if (isInited) | ||||||||||||||||||||||||||
|
| 2 | return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); | ||||||||||||||||||||||||||
2 | return (XMLNamespacePackage)EPackage.Registry.INSTANCE.getEPackage(XMLNamespacePackage.eNS_URI); |
| | ||||||||||||||||||||||||||
3 | XMLNamespacePackageImpl theXMLNamespacePackage = (XMLNamespacePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof XMLNamespacePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new XMLNamespacePackageImpl()); |
| 3 | XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof XMLTypePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new XMLTypePackageImpl()); | |||||||||||||||||||||||||
4 | isInited = true; | 4 | isInited = true; | ||||||||||||||||||||||||||
5 | XMLTypePackage.eINSTANCE.eClass(); | | |||||||||||||||||||||||||||
6 | theXMLNamespacePackage.createPackageContents(); |
| 5 | theXMLTypePackage.createPackageContents(); | |||||||||||||||||||||||||
7 | theXMLNamespacePackage.initializePackageContents(); |
| 6 | theXMLTypePackage.initializePackageContents(); | |||||||||||||||||||||||||
8 | EValidator.Registry.INSTANCE.put(theXMLNamespacePackage, new EValidator.Descriptor() {...}); |
| 7 | EValidator.Registry.INSTANCE.put(theXMLTypePackage, new EValidator.Descriptor() {...}); | |||||||||||||||||||||||||
9 | theXMLNamespacePackage.freeze(); |
| 8 | theXMLTypePackage.freeze(); | |||||||||||||||||||||||||
10 | return theXMLNamespacePackage; |
| 9 | return theXMLTypePackage; |
Row | Violation |
---|---|
1 | Unmatched return (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); |
2 | Unmatched return (XMLNamespacePackage)EPackage.Registry.INSTANCE.getEPackage(XMLNamespacePackage.eNS_URI); |
3 | Expression theXMLNamespacePackage cannot be unified with expression theXMLTypePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void createPackageContents() |
4 | Expression theXMLNamespacePackage cannot be unified with expression theXMLTypePackage , because common superclass org.eclipse.emf.ecore.impl.EPackageImpl does not declare member(s) public void initializePackageContents() |