FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), entryFeature);
for (int i = 0, size = delegateSize(); i < size; ++i)
{
Entry otherEntry = delegateGet(i);
if (validator.isValid(otherEntry.getEStructuralFeature()))
{
if (otherEntry.equals(object))
{
return false;
}
else
{
doSet(i, object);
return true;
}
}
}
FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature);
for (int i = 0, size = delegateSize(); i < size; ++i)
{
Entry entry = delegateGet(i);
if (validator.isValid(entry.getEStructuralFeature()))
{
if (isFeatureMap ? entry.equals(object) : object == null ? entry.getValue() == null : object.equals(entry.getValue()))
{
return false;
}
else
{
doSet(i, isFeatureMap ? (Entry)object : createEntry(feature, object));
return true;
}
}
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
|
Method name: boolean add(Entry)
|
|
Method name: boolean add(EStructuralFeature, Object)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), entryFeature);↵ | | 1 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature);↵
|
2 | for (int i = 0, size = delegateSize(); i < size; ++i)↵ | | 2 | for (int i = 0, size = delegateSize(); i < size; ++i)↵
|
3 | {↵ | | 3 | {↵
|
4 | Entry otherEntry = delegateGet(i);↵ | | 4 | Entry entry = delegateGet(i);↵
|
5 | if (validator.isValid(otherEntry.getEStructuralFeature()))↵ | | 5 | if (validator.isValid(entry.getEStructuralFeature()))↵
|
6 | {↵ | | 6 | {↵
|
7 | if (otherEntry.equals(object))↵ | | 7 | if (isFeatureMap ? entry.equals(object) : object == null ? entry.getValue() == null : object.equals(entry.getValue()))↵
|
8 | {↵ | | 8 | {↵
|
9 | return false;↵ | | 9 | return false;↵
|
10 | }↵ | | 10 | }↵
|
11 | else↵ | | 11 | else↵
|
12 | {↵ | | 12 | {↵
|
13 | doSet(i, object);↵ | | 13 | doSet(i, isFeatureMap ? (Entry)object : createEntry(feature, object));↵
|
14 | return true;↵ | | 14 | return true;↵
|
15 | }↵ | | 15 | }↵
|
16 | }↵ | | 16 | }↵
|
17 | } | | 17 | }
|
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 declared in the same class |
Number of node comparisons | 1 |