if (validator.isValid(otherEntry.getEStructuralFeature()))
{
if (otherEntry.equals(entry))
{
return false;
}
else
{
doSet(i, object);
return true;
}
}
if (validator.isValid(otherEntry.getEStructuralFeature()))
{
if (otherEntry.equals(object))
{
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/DelegatingFeatureMap.java
|
Method name: boolean add(Entry)
|
|
Method name: boolean add(Entry)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (validator.isValid(otherEntry.getEStructuralFeature()))↵ | | 1 | if (validator.isValid(otherEntry.getEStructuralFeature()))↵
|
2 | {↵ | | 2 | {↵
|
3 | if (otherEntry.equals(entry))↵ | | 3 | if (otherEntry.equals(object))↵
|
4 | {↵ | | 4 | {↵
|
5 | return false;↵ | | 5 | return false;↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | {↵ | | 8 | {↵
|
9 | doSet(i, object);↵ | | 9 | doSet(i, object);↵
|
10 | return true;↵ | | 10 | return true;↵
|
11 | }↵ | | 11 | }↵
|
12 | } | | 12 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 18 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | if (validator.isValid(otherEntry.getEStructuralFeature())) | | 8 | if (validator.isValid(otherEntry.getEStructuralFeature())) |
11 | if (otherEntry.equals(entry)) | | 9 | if (otherEntry.equals(object)) |
12 | | | 10 | |
| | | | |
13 | | | 11 | |
14 | | | 12 | |
Precondition Violations (4)
Row |
Violation |
1 | Conditional return true; |
2 | Conditional return true; |
3 | Conditional return false; |
4 | Conditional return false; |