Skip to main content



      Home
Home » Modeling » EMF » [CDO] NPE when requesting an EObject from a different view that is TRANSIENT
[CDO] NPE when requesting an EObject from a different view that is TRANSIENT [message #930337] Tue, 02 October 2012 04:14 Go to next message
Eclipse UserFriend
org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(T) leads to a NPE when the provided param is not yet registered in a repository, i.e. when its state is TRANSIENT.

Is that expected and do I have to check for that state myself or is that a bug?
Re: [CDO] NPE when requesting an EObject from a different view that is TRANSIENT [message #930383 is a reply to message #930337] Tue, 02 October 2012 05:05 Go to previous messageGo to next message
Eclipse UserFriend
Am 02.10.2012 10:14, schrieb Erdal Karaca:
> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(T) leads to a NPE
Can you please share the stack trace of that NPE?

> when the provided param is not yet registered in a repository, i.e. when its state is TRANSIENT.
>
> Is that expected and do I have to check for that state myself or is that a bug?
It's expected that the view can not return a non-null result in this case. But we can certainly discuss whether an NPE
is an adequate result :P
Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] NPE when requesting an EObject from a different view that is TRANSIENT [message #930398 is a reply to message #930383] Tue, 02 October 2012 05:20 Go to previous messageGo to next message
Eclipse UserFriend
I am now checking whether the object from a different view has a view at all prior to calling AbstractCDOView.getObject(), i.e. objectFromDifferentView.cdoView() != null and just return the object itself if it has no associated cdo view.

Stack trace (trimmed):
java.lang.NullPointerException
	at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:803)
Re: [CDO] NPE when requesting an EObject from a different view that is TRANSIENT [message #930422 is a reply to message #930398] Tue, 02 October 2012 05:48 Go to previous messageGo to next message
Eclipse UserFriend
Am 02.10.2012 11:20, schrieb Erdal Karaca:
> I am now checking whether the object from a different view has a view at all prior to calling
> AbstractCDOView.getObject(), i.e. objectFromDifferentView.cdoView() != null and just return the object itself if it
> has no associated cdo view.
Hmm, I think that's not what other users would expect to happen. If you submit a bugzilla I can add this:

if (view == null)
{
return null;
}

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] NPE when requesting an EObject from a different view that is TRANSIENT [message #930451 is a reply to message #930422] Tue, 02 October 2012 06:26 Go to previous messageGo to next message
Eclipse UserFriend
Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=390908
Re: [CDO] NPE when requesting an EObject from a different view that is TRANSIENT [message #930459 is a reply to message #930451] Tue, 02 October 2012 06:34 Go to previous message
Eclipse UserFriend
Am 02.10.2012 12:26, schrieb Erdal Karaca:
> Done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=390908
Fixed ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:Dynamic Model: invalid classifier
Next Topic:[CDO] react on remote model changes
Goto Forum:
  


Current Time: Thu Nov 06 22:21:49 EST 2025

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

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

Back to the top