if (feature.isUnique())
{
for (Object object : collection)
{
if (!contains(feature, object))
{
Entry entry = createEntry(feature, object);
entryCollection.add(entry);
}
}
}
else if (!isFeatureMap)
{
for (Object object : collection)
{
Entry entry = createEntry(feature, object);
entryCollection.add(entry);
}
}
if (feature.isUnique())
{
for (Object object : collection)
{
if (!contains(feature, object))
{
Entry entry = createEntry(feature, object);
entryCollection.add(entry);
}
}
}
else if (!isFeatureMap)
{
for (Object object : collection)
{
Entry entry = createEntry(feature, object);
entryCollection.add(entry);
}
}
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/DelegatingFeatureMap.java
|
Method name: boolean addAll(EStructuralFeature, int, Collection>)
|
|
Method name: boolean addAll(EStructuralFeature, int, Collection>)
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | if (feature.isUnique())↵ | | 1 | if (feature.isUnique())↵
|
2 | {↵ | | 2 | {↵
|
3 | for (Object object : collection)↵ | | 3 | for (Object object : collection)↵
|
4 | {↵ | | 4 | {↵
|
5 | if (!contains(feature, object))↵ | | 5 | if (!contains(feature, object))↵
|
6 | {↵ | | 6 | {↵
|
7 | Entry entry = createEntry(feature, object);↵ | | 7 | Entry entry = createEntry(feature, object);↵
|
8 | entryCollection.add(entry);↵ | | 8 | entryCollection.add(entry);↵
|
9 | }↵ | | 9 | }↵
|
10 | }↵ | | 10 | }↵
|
11 | }↵ | | 11 | }↵
|
12 | else if (!isFeatureMap)↵ | | 12 | else if (!isFeatureMap)↵
|
13 | {↵ | | 13 | {↵
|
14 | for (Object object : collection)↵ | | 14 | for (Object object : collection)↵
|
15 | {↵ | | 15 | {↵
|
16 | Entry entry = createEntry(feature, object);↵ | | 16 | Entry entry = createEntry(feature, object);↵
|
17 | entryCollection.add(entry);↵ | | 17 | entryCollection.add(entry);↵
|
18 | }↵ | | 18 | }↵
|
19 | } | | 19 | }
|
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 1.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | if (!contains(feature, object)) | | 8 | if (!contains(feature, object)) |
9 | Entry entry = createEntry(feature, object); | | 9 | Entry entry = createEntry(feature, object); |
10 | entryCollection.add(entry); | | 10 | entryCollection.add(entry); |
Precondition Violations (0)
Row |
Violation |