if (validator.isValid(entry.getEStructuralFeature()))
{
if (collection.contains(entry.getValue()))
{
return false;
}
else
{
throw new IllegalArgumentException("The multiplicity constraint is violated");
}
}
if (validator.isValid(entry.getEStructuralFeature()))
{
if (collection.contains(entry.getValue()))
{
return false;
}
else
{
throw new IllegalArgumentException("The multiplicity constraint is violated");
}
}
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(int, EStructuralFeature, Collection>)
|
|
Method name: boolean addAll(int, EStructuralFeature, Collection>)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (validator.isValid(entry.getEStructuralFeature()))↵ | | 1 | if (validator.isValid(entry.getEStructuralFeature()))↵
|
2 | {↵ | | 2 | {↵
|
3 | if (collection.contains(entry.getValue()))↵ | | 3 | if (collection.contains(entry.getValue()))↵
|
4 | {↵ | | 4 | {↵
|
5 | return false;↵ | | 5 | return false;↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | {↵ | | 8 | {↵
|
9 | throw new IllegalArgumentException("The multiplicity constraint is violated");↵ | | 9 | throw new IllegalArgumentException("The multiplicity constraint is violated");↵
|
10 | }↵ | | 10 | }↵
|
11 | } | | 11 | }
|
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 | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
25 | if (validator.isValid(entry.getEStructuralFeature())) | | 24 | if (validator.isValid(entry.getEStructuralFeature())) |
26 | if (collection.contains(entry.getValue())) | | 25 | if (collection.contains(entry.getValue())) |
27 | | | 26 | |
| | | | |
28 | throw new IllegalArgumentException("The multiplicity constraint is violated"); | | 27 | throw new IllegalArgumentException("The multiplicity constraint is violated"); |
Precondition Violations (3)
Row |
Violation |
1 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |
2 | Conditional return false; |
3 | Conditional return false; |