Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Bug in Generation with Feature Delegation Dynamic and unsettable opposites
Bug in Generation with Feature Delegation Dynamic and unsettable opposites [message #428980] Mon, 06 April 2009 12:40 Go to next message
J F is currently offline J FFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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/
Re: Bug in Generation with Feature Delegation Dynamic and unsettable opposites [message #428996 is a reply to message #428983] Mon, 06 April 2009 15:10 Go to previous message
J F is currently offline J FFriend
Messages: 256
Registered: July 2009
Senior Member
Bugs 271316, 271328
Previous Topic:error msg in validation framework
Next Topic:[Teneo] c3p0 and open connections
Goto Forum:
  


Current Time: Fri Apr 19 21:12:05 GMT 2024

Powered by FUDForum. Page generated in 0.02912 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top