File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/EMOFExtendedMetaData.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLLoadImpl.java | |||
Method name: String getName(EStructuralFeature)
|
Method name: String getLocalName(int)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 7 | |||
1 | XMLResource.XMLInfo info = xmlMap.getInfo(eStructuralFeature);↵ | 1 | Node node = attributes.item(index);↵ | |
2 | if (info != null)↵ | 2 | if (node != null)↵ | |
3 | {↵ | 3 | {↵ | |
4 | String name = info.getName();↵ | 4 | String prefix = node.getPrefix();↵ | |
5 | if (name != null)↵ | 5 | if (↵ | |
6 | ExtendedMetaData.XMLNS_PREFIX.equals(prefix))↵ | |||
6 | {↵ | 7 | {↵ | |
7 | return info.getName();↵ | 8 | return "";↵ | |
8 | }↵ | 9 | }↵ | |
9 | }↵ | 10 | ↵ | |
10 | return super.getName(eStructuralFeature)↵ | 11 | return node.getLocalName();↵ | |
12 | }↵ | |||
11 | ; | 13 | return null; | |
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 |
Number of node comparisons | 11 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 1.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Node node = attributes.item(index); | ||||||||||||||||
1 | XMLResource.XMLInfo info = xmlMap.getInfo(eStructuralFeature); | | ||||||||||||||||
2 | if (info != null) |
| 2 | if (node != null) | ||||||||||||||
|
| 3 | String prefix = node.getPrefix(); | |||||||||||||||
3 | String name = info.getName(); |
| | |||||||||||||||
| 4 | if (ExtendedMetaData.XMLNS_PREFIX.equals(prefix)) | ||||||||||||||||
|
| 5 | return ""; | |||||||||||||||
4 | if (name != null) | | ||||||||||||||||
5 | return info.getName(); |
| | |||||||||||||||
|
| 6 | return node.getLocalName(); | |||||||||||||||
6 | return super.getName(eStructuralFeature); |
| 7 | return null; |
Row | Violation |
---|---|
1 | Type org.eclipse.emf.ecore.xmi.XMLResource.XMLInfo of variable info does not match with type org.w3c.dom.Node of variable node |
2 | Unmatched statement String prefix=node.getPrefix(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement String name=info.getName(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return ""; |
5 | Unmatched statement return info.getName(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched return info.getName(); |
7 | Unmatched statement return node.getLocalName(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
8 | Unmatched return node.getLocalName(); |
9 | Super method call return super.getName(eStructuralFeature); cannot be extracted from method |
10 | The refactoring of the clones is infeasible, because classes org.eclipse.emf.ecore.xmi.impl.EMOFExtendedMetaData and org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.AttributesProxy do not have a common superclass |