File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java | |||
Method name: void addNamespaceDeclarations()
|
Method name: void addNamespaceDeclarations()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if (nsPrefix != null && nsPrefix.length() > 0)↵ | 1 | if (nsPrefix != null && nsPrefix.length() > 0)↵ | |
2 | {↵ | 2 | {↵ | |
3 | if (!declareXSI || !"xsi".equals(nsPrefix))↵ | 3 | if (!declareXSI || !"xsi".equals(nsPrefix))↵ | |
4 | {↵ | 4 | {↵ | |
5 | doc.addAttributeNS(XMLResource.XML_NS, nsPrefix, nsURI);↵ | 5 | ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI, XMLResource.XML_NS +":" + nsPrefix, nsURI);↵ | |
6 | }↵ | 6 | }↵ | |
7 | }↵ | 7 | }↵ | |
8 | else↵ | 8 | else↵ | |
9 | {↵ | 9 | {↵ | |
10 | doc.addAttribute(XMLResource.XML_NS, nsURI);↵ | 10 | ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI, XMLResource.XML_NS, nsURI);↵ | |
11 | } | 11 |
| |
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 10 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
76 | if (nsPrefix != null && nsPrefix.length() > 0) | 80 | if (nsPrefix != null && nsPrefix.length() > 0) | ||||
77 | if (!declareXSI || !"xsi".equals(nsPrefix)) | 81 | if (!declareXSI || !"xsi".equals(nsPrefix)) | ||||
78 | doc.addAttributeNS(XMLResource.XML_NS, nsPrefix, nsURI); |
| | ||||
|
| 82 | ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI, XMLResource.XML_NS + ":" + nsPrefix, nsURI); | ||||
else | | ||||||
79 | doc.addAttribute(XMLResource.XML_NS, nsURI); | | |||||
| 83 | ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI, XMLResource.XML_NS, nsURI); |
Row | Violation |
---|---|
1 | Unmatched statement doc.addAttributeNS(XMLResource.XML_NS,nsPrefix,nsURI); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement ((Element)currentNode).setAttributeNS(ExtendedMetaData.XMLNS_URI,XMLResource.XML_NS + ":" + nsPrefix,nsURI); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |