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;
}
}
List<EStructuralFeature> structuralFeatures = eClass.getEAllStructuralFeatures();
for (int i = 0, size = structuralFeatures.size(); i < size; ++i)
{
EStructuralFeature eStructuralFeature = structuralFeatures.get(i);
if (name.equals(extendedMetaData.getName(eStructuralFeature))
&& (namespaceURI == null ? extendedMetaData.getNamespace(eStructuralFeature) == null : namespaceURI.equals(extendedMetaData.getNamespace(eStructuralFeature))))
{
return eStructuralFeature;
}
}
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/xmi/impl/XMLHelperImpl.java
|
Method name: EReference getXSISchemaLocationMapFeature(EClass)
|
|
Method name: EStructuralFeature getFeature(EClass, String, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | List<EReference> eAllReferences = eClass.getEAllReferences();↵ | | 1 | List<EStructuralFeature> structuralFeatures = eClass.getEAllStructuralFeatures();↵
|
2 | for (int i = 0, size = eAllReferences.size(); i < size; ++i)↵ | | 2 | for (int i = 0, size = structuralFeatures.size(); i < size; ++i)↵
|
3 | {↵ | | 3 | {↵
|
4 | EReference eReference = eAllReferences.get(i);↵ | | 4 | EStructuralFeature eStructuralFeature = structuralFeatures.get(i);↵
|
5 | if ("xsi:schemaLocation".equals(getName(eReference↵ | | 5 | if (name.equals(extendedMetaData.getName(eStructuralFeature))↵
|
6 | )))↵ | | 6 | && (namespaceURI == null ? extendedMetaData.getNamespace(eStructuralFeature) == null : namespaceURI.equals(extendedMetaData.getNamespace(eStructuralFeature))))↵
|
7 | {↵ | | 7 | ↵
|
| | | 8 | {↵
|
8 | return eReference;↵ | | 9 | return eStructuralFeature;↵
|
9 | }↵ | | 10 | }↵
|
10 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 1 |