Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EcrossReferenceAdapter ClassCastException
EcrossReferenceAdapter ClassCastException [message #482752] Thu, 27 August 2009 19:22 Go to next message
Travis London is currently offline Travis LondonFriend
Messages: 14
Registered: July 2009
Junior Member
Hello,

I am hitting a ClassCastException (CCE) at line 613 of
ECrossReferenceAdapter.java. I searched the eclipse newsgroups and found
one entry related but did not understand how it was resolved. I am using
EMF version 2.4.2, with GMF 1.1.3. The CCE is occuring due to an unset
notification from my domain model, where the unset is for a reference with
an upper bound of many (*). The call to unset is generated, and not
modified. It results in calling EObjectEList.unset(), which in turn calls
owner.eNotify(createNotification(Notification.UNSET, oldIsSet, false));

The ECrossReferenceAdapter class is trying to cast the notification's old
value to an EObject, which is failing because it is an instance of Boolean.

Any help would be greatly appreciated.

Thanks in advance,
Travis London
Re: EcrossReferenceAdapter ClassCastException [message #482762 is a reply to message #482752] Thu, 27 August 2009 20:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Travis,

It sounds like a bug (and oversight). I recall a similar bug coming up
in the ChangeRecorder; you can look at how it handles this case..
Please open a bugzilla. I'll try to get a patch into it as soon as
possible. I'm not sure what to suggest for such an old version, other
than applying the patch yourself to the older source...


Travis London wrote:
> Hello,
>
> I am hitting a ClassCastException (CCE) at line 613 of
> ECrossReferenceAdapter.java. I searched the eclipse newsgroups and
> found one entry related but did not understand how it was resolved. I
> am using EMF version 2.4.2, with GMF 1.1.3. The CCE is occuring due
> to an unset notification from my domain model, where the unset is for
> a reference with an upper bound of many (*). The call to unset is
> generated, and not modified. It results in calling
> EObjectEList.unset(), which in turn calls
> owner.eNotify(createNotification(Notification.UNSET, oldIsSet, false));
>
> The ECrossReferenceAdapter class is trying to cast the notification's
> old value to an EObject, which is failing because it is an instance of
> Boolean.
>
> Any help would be greatly appreciated.
>
> Thanks in advance,
> Travis London
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EcrossReferenceAdapter ClassCastException [message #482770 is a reply to message #482762] Thu, 27 August 2009 21:15 Go to previous messageGo to next message
Travis London is currently offline Travis LondonFriend
Messages: 14
Registered: July 2009
Junior Member
Thank you very much for the input. I will watch the issue for a patch.
Re: EcrossReferenceAdapter ClassCastException [message #482783 is a reply to message #482762] Thu, 27 August 2009 23:21 Go to previous messageGo to next message
Travis London is currently offline Travis LondonFriend
Messages: 14
Registered: July 2009
Junior Member
That patch worked for me. Is this fix in a newer version? Or is it
something you will have to add?

Also it turns out the GMF CrossReferenceAdapter class has the same
problem. I will bring it up on their news group.

Thanks, again.
Re: EcrossReferenceAdapter ClassCastException [message #482839 is a reply to message #482783] Fri, 28 August 2009 10:15 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Travis,

I'll need to apply this patch for 2.6.

You'd better open a separate bugzilla for GMF.


Travis London wrote:
> That patch worked for me. Is this fix in a newer version? Or is it
> something you will have to add?
>
> Also it turns out the GMF CrossReferenceAdapter class has the same
> problem. I will bring it up on their news group.
>
> Thanks, again.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Populating EMF Resource using default serialization and Non-containment from Database - Want to avoi
Next Topic:Send a xml as inputStream
Goto Forum:
  


Current Time: Sat Apr 27 03:49:14 GMT 2024

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

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

Back to the top