if (getContentKind(eClass) == MIXED_CONTENT)
{
List<EReference> eAllReferences = eClass.getEAllReferences();
for (int i = 0, size = eAllReferences.size(); i < size; ++i)
{
EReference eReference = eAllReferences.get(i);
if ("xmlns:prefix".equals(getName(eReference)))
{
return eReference;
}
}
}
return null;
if (getContentKind(eClass) == MIXED_CONTENT)
{
List<EReference> eAllReferences = eClass.getEAllReferences();
for (int i = 0, size = eAllReferences.size(); i < size; ++i)
{
EReference eReference = eAllReferences.get(i);
if ("xsi:schemaLocation".equals(getName(eReference)))
{
return eReference;
}
}
}
return null;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
|
Method name: EReference getXMLNSPrefixMapFeature(EClass)
|
|
Method name: EReference getXSISchemaLocationMapFeature(EClass)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (getContentKind(eClass) == MIXED_CONTENT)↵ | | 1 | if (getContentKind(eClass) == MIXED_CONTENT)↵
|
2 | {↵ | | 2 | {↵
|
3 | List<EReference> eAllReferences = eClass.getEAllReferences();↵ | | 3 | List<EReference> eAllReferences = eClass.getEAllReferences();↵
|
4 | for (int i = 0, size = eAllReferences.size(); i < size; ++i)↵ | | 4 | for (int i = 0, size = eAllReferences.size(); i < size; ++i)↵
|
5 | {↵ | | 5 | {↵
|
6 | EReference eReference = eAllReferences.get(i);↵ | | 6 | EReference eReference = eAllReferences.get(i);↵
|
7 | if ("xmlns:prefix".equals(getName(eReference)))↵ | | 7 | if ("xsi:schemaLocation".equals(getName(eReference)))↵
|
8 | {↵ | | 8 | {↵
|
9 | return eReference;↵ | | 9 | return eReference;↵
|
10 | }↵ | | 10 | }↵
|
11 | }↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
|
13 | return null; | | 13 | return null;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 6.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (getContentKind(eClass) == MIXED_CONTENT) | | 1 | if (getContentKind(eClass) == MIXED_CONTENT) |
2 | List<EReference> eAllReferences = eClass.getEAllReferences(); | | 2 | List<EReference> eAllReferences = eClass.getEAllReferences(); |
3 | for (int i = 0, size = eAllReferences.size(); i < size; ++i) | | 3 | for (int i = 0, size = eAllReferences.size(); i < size; ++i) |
4 | EReference eReference = eAllReferences.get(i); | | 4 | EReference eReference = eAllReferences.get(i); |
5 | if ("xmlns:prefix".equals(getName(eReference))) | | 5 | if ("xsi:schemaLocation".equals(getName(eReference))) |
6 | | | 6 | |
7 | return null; | | 7 | return null; |
Precondition Violations (0)
Row |
Violation |