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;
}
}
List<EStructuralFeature> allAttributes = getAllAttributes(eClass);
for (int i = 0, size = allAttributes.size(); i < size; ++i)
{
EStructuralFeature result = allAttributes.get(i);
if (matches(getWildcards(result), namespace))
{
return result;
}
}
return null;
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/util/BasicExtendedMetaData.java
|
Method name: EStructuralFeature getFeature(EClass, String, String)
|
|
Method name: EStructuralFeature getAttributeWildcardAffiliation(EClass, String, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 6
|
|
1 | List<EStructuralFeature> structuralFeatures = eClass.getEAllStructuralFeatures();↵ | | 1 | List<EStructuralFeature> allAttributes = getAll↵
|
2 | ↵ | | 2 | Attributes(eClass);↵
|
3 | for (int i = 0, size = structuralFeatures.size(); i < size; ++i)↵ | | 3 | for (int i = 0, size = allAttributes.size(); i < size; ++i)↵
|
4 | {↵ | | 4 | {↵
|
5 | EStructuralFeature eStructuralFeature = structuralFeatures.get(i);↵ | | 5 | EStructuralFeature result = allAttributes.get(i);↵
|
6 | if (name.equals(extendedMetaData.getName(eStructuralFeature))↵ | | 6 | if (↵
|
7 | && (namespaceURI == null ? extendedMetaData.getNamespace(eStructuralFeature) == null : namespaceURI.equals(extendedMetaData.getNamespace(eStructuralFeature))))↵ | | 7 | matches(getWildcards(result), namespace))↵
|
8 | {↵ | | 8 | ↵
|
9 | ↵ | | 9 | {↵
|
10 | return eStructuralFeature;↵ | | 10 | return result;↵
|
11 | ↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
|
13 | } | | 13 | return null;
|
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 |