File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java | |||
Method name: boolean isEmpty(EStructuralFeature)
|
Method name: void add(EStructuralFeature, int, Object)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 5 | |||
1 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature);↵ | 1 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature);↵ | |
2 | for (int i = 0, size = delegateSize(); i < size; ++i)↵ | 2 | for (int i = 0, size = delegateSize(); i < size; ++i)↵ | |
3 | {↵ | 3 | ↵ | |
4 | {↵ | |||
4 | Entry entry = delegateGet(i);↵ | 5 | Entry entry = delegateGet(i);↵ | |
5 | if (validator.isValid(entry.getEStructuralFeature()))↵ | 6 | if (validator.isValid(entry.getEStructuralFeature()))↵ | |
6 | {↵ | 7 | {↵ | |
7 | return false;↵ | 8 | ↵ | |
8 | }↵ | |||
9 | }↵ | |||
10 | return true; | 9 | throw new IllegalArgumentException("The multiplicity constraint is violated");↵ | |
10 | }↵ | |||
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
Number of mapped statements | 4 |
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.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature); | 5 | FeatureMapUtil.Validator validator = FeatureMapUtil.getValidator(owner.eClass(), feature); | ||||
2 | for (int i = 0, size = delegateSize(); i < size; ++i) | 6 | for (int i = 0, size = delegateSize(); i < size; ++i) | ||||
3 | Entry entry = delegateGet(i); | 7 | Entry entry = delegateGet(i); | ||||
4 | if (validator.isValid(entry.getEStructuralFeature())) | 8 | if (validator.isValid(entry.getEStructuralFeature())) | ||||
5 | return false; |
| | ||||
|
| 9 | throw new IllegalArgumentException("The multiplicity constraint is violated"); | ||||
6 | return true; |
| |
Row | Violation |
---|---|
1 | Unmatched return false; |
2 | Unmatched throw new IllegalArgumentException("The multiplicity constraint is violated"); |
3 | Unmatched return true; |