if (isContainment())
{
if (oldValue != newValue)
{
if (oldValue != null)
{
notifications =
((InternalEObject)oldValue).eInverseRemove
(owner,
InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(feature),
null,
notifications);
}
if (newValue != null)
{
notifications =
((InternalEObject)newValue).eInverseAdd
(owner,
InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(feature),
null,
notifications);
}
}
}
if (hasInverse())
{
if (oldValue != otherEnd && oldValue != null)
{
InternalEObject internalEObject = (InternalEObject)oldValue;
notifications =
internalEObject.eInverseRemove
(owner,
internalEObject.eClass().getFeatureID(inverseFeature),
null,
notifications);
}
}
else if (isContainment())
{
if (oldValue != null)
{
notifications =
((InternalEObject)oldValue).eInverseRemove
(owner,
InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(feature),
null,
notifications);
}
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java
|
Method name: void dynamicSet(InternalEObject, EStructuralFeature.Internal.DynamicValueHolder, int, Object)
|
|
Method name: NotificationChain dynamicInverseAdd(InternalEObject, EStructuralFeature.Internal.DynamicValueHolder, int, InternalEObject, NotificationChain)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 7
|
|
1 | if (isContainment())↵ | | 1 | if (hasInverse())↵
|
2 | {↵ | | 2 | {↵
|
3 | if (oldValue != newValue)↵ | | 3 | if (oldValue != ↵
|
4 | {↵ | | |
|
5 | if (oldValue != null)↵ | | |
|
6 | {↵ | | |
|
7 | ↵ | | 4 | otherEnd && oldValue != null)↵
|
| | | 5 | {↵
|
| | | 6 | InternalEObject internalEObject = (InternalEObject)oldValue;↵
|
8 | notifications = ↵ | | 7 | notifications = ↵
|
9 | ((InternalEObject)oldValue).eInverseRemove↵ | | 8 | internalEObject.eInverseRemove↵
|
10 | (owner,↵ | | 9 | (owner,↵
|
11 | InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(feature),↵ | | 10 | internalEObject.eClass().getFeatureID(inverseFeature),↵
|
12 | null,↵ | | 11 | null,↵
|
13 | notifications);↵ | | 12 | notifications);↵
|
14 | ↵ | | 13 | }↵
|
15 | }↵ | | 14 | }↵
|
16 | ↵ | | 15 | else if (isContainment())↵
|
| | | 16 | {↵
|
17 | if (newValue != null)↵ | | 17 | if (oldValue != null)↵
|
18 | {↵ | | 18 | ↵
|
19 | ↵ | | 19 | {↵
|
20 | notifications = ↵ | | 20 | notifications = ↵
|
21 | ((InternalEObject)newValue).eInverseAdd↵ | | 21 | ((InternalEObject)oldValue).eInverse↵
|
22 | ↵ | | 22 | Remove↵
|
23 | (owner,↵ | | 23 | (owner,↵
|
24 | InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(feature),↵ | | 24 | InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(feature),↵
|
25 | null,↵ | | 25 | null,↵
|
26 | notifications);↵ | | 26 | notifications);↵
|
27 | }↵ | | |
|
28 | }↵ | | 27 | }↵
|
29 | } | | 28 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 8 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 1.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
16 | if (oldValue != null) | | 9 | if (oldValue != null) |
17 | notifications = ((InternalEObject)oldValue).eInverseRemove(owner, InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(feature), null, notifications); | | 10 | notifications = ((InternalEObject)oldValue).eInverseRemove(owner, InternalEObject.EOPPOSITE_FEATURE_BASE - owner.eClass().getFeatureID(feature), null, notifications); |
Precondition Violations (0)
Row |
Violation |