Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » NP Exception in EStructuralFeature.Internal.SettingDelegate
NP Exception in EStructuralFeature.Internal.SettingDelegate [message #1725218] Tue, 01 March 2016 19:26 Go to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 312
Registered: February 2012
Location: Düsseldorf
Senior Member
Hi,
in the UML Model the "Class" has an annotation "duplicates" which has an EReference as child. It's "ownedAttribute" of type "Property".
Therefore the container of this EReference is an Annotation and not a EClass.

In EStructuralFeature.Internal.SettingDelegate the following code causes a NP in this case:

 EClass eClass  = getEContainingClass();
 eClass.getFeatureCount();
 EReference eOpposite = getEOpposite();
 if (eOpposite != null)
 {
   eOpposite.getEContainingClass().getFeatureCount();
 }


This is because eOppositeEContainingClass returns null as the EReference is contained in an Annotation.

Maybe it makes sense to add a NP check here?

Regards,
Thorsten
Re: NP Exception in EStructuralFeature.Internal.SettingDelegate [message #1725273 is a reply to message #1725218] Wed, 02 March 2016 08:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Thorsten,

How does such a problem arise? Anyone who is trying to get a setting
delegate for an EStructuralFeature that isn't contained by an EClass is
going to have a problem anyway. It might as well fail fast...


On 01.03.2016 20:26, Thorsten Schlathölter wrote:
> Hi,
> in the UML Model the "Class" has an annotation "duplicates" which has
> an EReference as child. It's "ownedAttribute" of type "Property".
> Therefore the container of this EReference is an Annotation and not a
> EClass.
>
> In EStructuralFeature.Internal.SettingDelegate the following code
> causes a NP in this case:
>
>
> EClass eClass = getEContainingClass();
> eClass.getFeatureCount();
> EReference eOpposite = getEOpposite();
> if (eOpposite != null)
> {
> eOpposite.getEContainingClass().getFeatureCount();
> }
>
>
> This is because eOppositeEContainingClass returns null as the
> EReference is contained in an Annotation.
> Maybe it makes sense to add a NP check here?
>
> Regards,
> Thorsten


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: NP Exception in EStructuralFeature.Internal.SettingDelegate [message #1725380 is a reply to message #1725273] Thu, 03 March 2016 07:30 Go to previous messageGo to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 312
Registered: February 2012
Location: Düsseldorf
Senior Member
I was trying to get the Edapt framework running together with a reference to a UML Model. I tried to add the UML model to the history of Edapt. And while edapt is trying to migrate the model, it runs into this exception and the migration fails.

I think it is not a good idea to add the model to the history anyway. But I was asked to try this out. I think the problem is then in the model and\or edapt. I was just wondering if a NP check would make sense here.

Regards,
Thorsten

[Updated on: Thu, 03 March 2016 07:32]

Report message to a moderator

Re: NP Exception in EStructuralFeature.Internal.SettingDelegate [message #1725399 is a reply to message #1725380] Thu, 03 March 2016 09:55 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I don't understand what you are doing so the following may be completely
misguided....

You seem to be mixing Ecore and UML technologies in ways that I have
never seen attempted before and consequently encountering some difficulties.

Perhaps you are pioneering some new flexibility. However I suspect that
you are failing to distinguish the UML / Ecore worlds and so you create
irrelevant problems. I suggest that you ensure that you understand how
different UML is from Ecore and what the UML2 project provides before
proceeding.

Regards

Ed Willink




On 03/03/2016 07:30, Thorsten Schlathölter wrote:
> I was trying to get the Edapt framework running together with a
> reference to a UML Model. I tried to add the UML model to the history
> of Edapt. And while edapt is trying to migrate the model, it runs into
> this exception and the migration fails.
>
> The problem is then in the model and\or edapt. I was just wondering if
> a NP check would make sense here.
>
> Regards,
> Thorsten
>
Previous Topic:[XCORE] is there a way to use "break" in a for loop defined in an xcore file?
Next Topic:Feature 'xmi' not found exception
Goto Forum:
  


Current Time: Thu Apr 25 10:02:38 GMT 2024

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

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

Back to the top