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