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 isEmpty(EStructuralFeature)
|
Method name: void add(int, Entry)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
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 | return false;↵ | 8 | throw new IllegalArgumentException("The multiplicity constraint is violated");↵ | |
9 | }↵ | 9 | ↵ | |
10 | }↵ | 10 | }↵ | |
11 | return true; | 11 | } | |
See real code fragment | See real code fragment |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature); |
| 10 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), entryFeature); | ||||||||||
2 | Entry[] entries = (Entry[])data; | 11 | Entry[] entries = (Entry[])data; | |||||||||||
3 | for (int i = 0; i < size; ++i) | 12 | for (int i = 0; i < size; ++i) | |||||||||||
4 | Entry entry = entries[i]; |
| 13 | Entry otherEntry = entries[i]; | ||||||||||
5 | if (validator.isValid(entry.getEStructuralFeature())) |
| 14 | if (validator.isValid(otherEntry.getEStructuralFeature())) | ||||||||||
6 | return false; |
| | |||||||||||
|
| 15 | throw new IllegalArgumentException("The multiplicity constraint is violated"); | |||||||||||
7 | return true; |
| |
Row | Violation |
---|---|
1 | Unmatched return false; |
2 | Unmatched throw new IllegalArgumentException("The multiplicity constraint is violated"); |
3 | Unmatched return true; |