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: NotificationChain eDynamicInverseAdd(InternalEObject, int, Class>, NotificationChain)
|
Method name: NotificationChain eDynamicInverseAdd(InternalEObject, int, Class>, NotificationChain)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID);↵ | 1 | EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID);↵ | |
2 | if (feature.isMany())↵ | 2 | if (feature.isMany())↵ | |
3 | {↵ | 3 | {↵ | |
4 | return featureMap.basicAdd(feature, otherEnd, notifications);↵ | 4 | return featureMap.basicAdd(feature, otherEnd, notifications);↵ | |
5 | }↵ | 5 | }↵ | |
6 | else if (feature instanceof EReference && ((EReference)feature).isContainer())↵ | 6 | else if (feature instanceof EReference && ((EReference)feature).isContainer())↵ | |
7 | {↵ | 7 | {↵ | |
8 | return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications);↵ | 8 | return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications);↵ | |
9 | }↵ | 9 | }↵ | |
10 | else↵ | 10 | else↵ | |
11 | {↵ | 11 | {↵ | |
12 | InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false);↵ | 12 | InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false);↵ | |
13 | if (oldValue != null)↵ | 13 | if (oldValue != null)↵ | |
14 | {↵ | 14 | {↵ | |
15 | notifications = oldValue.eInverseRemove↵ | 15 | notifications = oldValue.eInverseRemove↵ | |
16 | (this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications);↵ | 16 | (this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications);↵ | |
17 | notifications = featureMap.basicRemove(feature, oldValue, notifications);↵ | 17 | notifications = featureMap.basicRemove(feature, oldValue, notifications);↵ | |
18 | }↵ | 18 | }↵ | |
19 | return featureMap.basicAdd(feature, otherEnd, notifications);↵ | 19 | return featureMap.basicAdd(feature, otherEnd, notifications);↵ | |
20 | } | 20 |
| |
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 39 |
Number of mapped statements | 10 |
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) | 40.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID); | 1 | EStructuralFeature.Internal feature = (EStructuralFeature.Internal)eClass().getEStructuralFeature(featureID); | ||||||||||||
2 | if (feature.isMany()) | 2 | if (feature.isMany()) | ||||||||||||
3 | return featureMap.basicAdd(feature, otherEnd, notifications); |
| 3 | return featureMap.basicAdd(feature, otherEnd, notifications); | |||||||||||
4 | else if (feature instanceof EReference && ((EReference)feature).isContainer()) | 4 | else if (feature instanceof EReference && ((EReference)feature).isContainer()) | ||||||||||||
5 | return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications); | 5 | return eSettingDelegate(feature).dynamicInverseAdd(this, null, -1, otherEnd, notifications); | ||||||||||||
else | else | ||||||||||||||
6 | InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false); | 6 | InternalEObject oldValue = (InternalEObject)eDynamicGet(feature, false); | ||||||||||||
7 | if (oldValue != null) | 7 | if (oldValue != null) | ||||||||||||
8 | notifications = oldValue.eInverseRemove(this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications); | 8 | notifications = oldValue.eInverseRemove(this, oldValue.eClass().getFeatureID(((EReference)feature).getEOpposite()), null, notifications); | ||||||||||||
9 | notifications = featureMap.basicRemove(feature, oldValue, notifications); |
| 9 | notifications = featureMap.basicRemove(feature, oldValue, notifications); | |||||||||||
10 | return featureMap.basicAdd(feature, otherEnd, notifications); |
| 10 | return featureMap.basicAdd(feature, otherEnd, notifications); |
Row | Violation |
---|---|
1 | Expression featureMap cannot be unified with expression featureMap , because common superclass java.util.AbstractList<org.eclipse.emf.ecore.util.FeatureMap.Entry> does not declare member(s) public org.eclipse.emf.common.notify.NotificationChain basicAdd(org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, org.eclipse.emf.common.notify.NotificationChain) |
2 | Expression featureMap cannot be unified with expression featureMap , because common superclass java.util.AbstractList<org.eclipse.emf.ecore.util.FeatureMap.Entry> does not declare member(s) public org.eclipse.emf.common.notify.NotificationChain basicRemove(org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, org.eclipse.emf.common.notify.NotificationChain) |
3 | Expression featureMap cannot be unified with expression featureMap , because common superclass java.util.AbstractList<org.eclipse.emf.ecore.util.FeatureMap.Entry> does not declare member(s) public org.eclipse.emf.common.notify.NotificationChain basicAdd(org.eclipse.emf.ecore.EStructuralFeature, java.lang.Object, org.eclipse.emf.common.notify.NotificationChain) |