Bug in Generation with Feature Delegation Dynamic and unsettable opposites [message #428980] |
Mon, 06 April 2009 12:40 |
J F Messages: 256 Registered: July 2009 |
Senior Member |
|
|
Using Eclipse Modeling Framework (EMF) All-In-One
SDK 2.5.0.v200903161215 org.eclipse.emf.all.feature.group
I have a bug generating with Feature Delegation set to Dynamic;
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="Bug"
nsURI="http://test.bug/Bug" nsPrefix="bug">
<eClassifiers xsi:type="ecore:EClass" name="A">
<eStructuralFeatures xsi:type="ecore:EReference" name="one"
eType="#//B" unsettable="true"
containment="true" eOpposite="#//B/inverseOne"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="two"
eType="#//B" eOpposite="#//B/inverseTwo"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="B">
<eStructuralFeatures xsi:type="ecore:EReference" name="inverseOne"
eType="#//A"
unsettable="true" eOpposite="#//A/one"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="inverseTwo"
eType="#//A"
eOpposite="#//A/two"/>
</eClassifiers>
</ecore:EPackage>
Gives rise to
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicUnsetOne(NotificationChain msgs) {
B oldOne = one;
one = null;
boolean oldOneESet = oneESet;
oneESet = false;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this,
Notification.UNSET, BugPackage.A__ONE, oldOne, null, oldOneESet);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
which is called by
public NotificationChain eInverseRemove(InternalEObject otherEnd, int
featureID, NotificationChain msgs) {
switch (featureID) {
case BugPackage.A__ONE:
return basicUnsetOne(msgs);
case BugPackage.A__TWO:
return basicSetTwo(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
I'm sure we have spoken about this before, apologies .
1) What's the best workaround;
2) Should I report it as a bug ( can't find it on bugzilla )
|
|
|
Re: Bug in Generation with Feature Delegation Dynamic and unsettable opposites [message #428983 is a reply to message #428980] |
Mon, 06 April 2009 14:03 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
JF,
No doubt a case that was overlooked. Please open a bugzilla.
JF wrote:
> Using Eclipse Modeling Framework (EMF) All-In-One SDK
> 2.5.0.v200903161215 org.eclipse.emf.all.feature.group
>
> I have a bug generating with Feature Delegation set to Dynamic;
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="Bug"
> nsURI="http://test.bug/Bug" nsPrefix="bug">
> <eClassifiers xsi:type="ecore:EClass" name="A">
> <eStructuralFeatures xsi:type="ecore:EReference" name="one"
> eType="#//B" unsettable="true"
> containment="true" eOpposite="#//B/inverseOne"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="two"
> eType="#//B" eOpposite="#//B/inverseTwo"/>
> </eClassifiers>
> <eClassifiers xsi:type="ecore:EClass" name="B">
> <eStructuralFeatures xsi:type="ecore:EReference" name="inverseOne"
> eType="#//A"
> unsettable="true" eOpposite="#//A/one"/>
> <eStructuralFeatures xsi:type="ecore:EReference" name="inverseTwo"
> eType="#//A"
> eOpposite="#//A/two"/>
> </eClassifiers>
> </ecore:EPackage>
>
>
> Gives rise to
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> public NotificationChain basicUnsetOne(NotificationChain msgs) {
> B oldOne = one;
> one = null;
> boolean oldOneESet = oneESet;
> oneESet = false;
> if (eNotificationRequired()) {
> ENotificationImpl notification = new
> ENotificationImpl(this, Notification.UNSET, BugPackage.A__ONE, oldOne,
> null, oldOneESet);
> if (msgs == null) msgs = notification; else
> msgs.add(notification);
> }
> return msgs;
> }
>
> which is called by
> public NotificationChain eInverseRemove(InternalEObject otherEnd, int
> featureID, NotificationChain msgs) {
> switch (featureID) {
> case BugPackage.A__ONE:
> return basicUnsetOne(msgs);
> case BugPackage.A__TWO:
> return basicSetTwo(null, msgs);
> }
> return super.eInverseRemove(otherEnd, featureID, msgs);
> }
>
> I'm sure we have spoken about this before, apologies .
> 1) What's the best workaround;
> 2) Should I report it as a bug ( can't find it on bugzilla )
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.02912 seconds