XMLResource.XMLInfo clsInfo = xmlMap.getInfo(c);
if (clsInfo != null)
{
String targetNamespace = clsInfo.getTargetNamespace();
nameInfo.setNamespaceURI(targetNamespace);
nameInfo.setQualifiedName(getQName(targetNamespace, name));
return;
}
XMLResource.XMLInfo clsInfo = xmlMap.getInfo(eDataType);
if (clsInfo != null)
{
String targetNamespace = clsInfo.getTargetNamespace();
nameInfo.setNamespaceURI(targetNamespace);
nameInfo.setQualifiedName(getQName(targetNamespace, name));
return;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java
|
Method name: void populateNameInfo(NameInfo, EClass)
|
|
Method name: void populateNameInfo(NameInfo, EDataType)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | XMLResource.XMLInfo clsInfo = xmlMap.getInfo(c);↵ | | 1 | XMLResource.XMLInfo clsInfo = xmlMap.getInfo(eDataType);↵
|
|
2 | if (clsInfo != null)↵ | | 2 | if (clsInfo != null)↵
|
3 | {↵ | | 3 | {↵
|
4 | String targetNamespace = clsInfo.getTargetNamespace();↵ | | 4 | String targetNamespace = clsInfo.getTargetNamespace();↵
|
5 | nameInfo.setNamespaceURI(targetNamespace);↵ | | 5 | nameInfo.setNamespaceURI(targetNamespace);↵
|
6 | nameInfo.setQualifiedName(getQName(targetNamespace, name));↵ | | 6 | nameInfo.setQualifiedName(getQName(targetNamespace, name));↵
|
7 | return;↵ | | 7 | return;↵
|
8 | } | | 8 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 declared in the same class |
Number of node comparisons | 27 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 14.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | XMLResource.XMLInfo clsInfo = xmlMap.getInfo(c); | | 4 | XMLResource.XMLInfo clsInfo = xmlMap.getInfo(eDataType); |
5 | if (clsInfo != null) | | 5 | if (clsInfo != null) |
6 | String targetNamespace = clsInfo.getTargetNamespace(); | | 6 | String targetNamespace = clsInfo.getTargetNamespace(); |
7 | nameInfo.setNamespaceURI(targetNamespace); | | 7 | nameInfo.setNamespaceURI(targetNamespace); |
8 | nameInfo.setQualifiedName(getQName(targetNamespace, name)); | | 8 | nameInfo.setQualifiedName(getQName(targetNamespace, name)); |
9 | | | 9 | |
Precondition Violations (3)
Row |
Violation |
1 | Type org.eclipse.emf.ecore.EClass of variable c does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType |
2 | Conditional return; |
3 | Conditional return; |