Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] NPE in PersistentStoreAdapter
[Teneo] NPE in PersistentStoreAdapter [message #138183] Wed, 08 July 2009 07:59 Go to next message
Roland Brand is currently offline Roland BrandFriend
Messages: 42
Registered: July 2009
Member
Hi

I'm using Teneo with Hibernate and just upgraded from Teneo 1.0.0 to Teneo
1.1.0. When testing my code I ran into a Problem when removing entries
from a map.

Stepping down with the debugger, I suspect Line 137 of
org.eclipse.emf.teneo.type.PersistentStoreAdapter to be wrong. Here is a
short excerpt:

case Notification.REMOVE:
if (list != null) {
if (notification.getPosition() != Notification.NO_INDEX) {
list.remove(notification.getPosition());
} else {
list.remove(replaceValue(notification.getOldValue(), eFeature));
}
}
if (map != null) {
final Map.Entry<?, ?> entry = (Map.Entry<?, ?>)
notification.getNewValue();
map.remove(entry.getKey());
}
break;


I suggest, that the line getting the Map.Entry should call
notification.getOldValue() instead of notification.getNewValue(). The new
value is null and thus causes a NullPointerException at map.remove().

Could somebody please verify this? Am I missing something?

Thanks,
Roland
Re: [Teneo] NPE in PersistentStoreAdapter [message #138190 is a reply to message #138183] Wed, 08 July 2009 08:13 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Roland,
Afaics you are completely correct. Can you enter a bugzilla for this? Then I will pick this up in the next build which
will be today or tomorrow (after I solved this).

gr. Martin

Roland Brand wrote:
> Hi
>
> I'm using Teneo with Hibernate and just upgraded from Teneo 1.0.0 to
> Teneo 1.1.0. When testing my code I ran into a Problem when removing
> entries from a map.
>
> Stepping down with the debugger, I suspect Line 137 of
> org.eclipse.emf.teneo.type.PersistentStoreAdapter to be wrong. Here is a
> short excerpt:
>
> case Notification.REMOVE:
> if (list != null) {
> if (notification.getPosition() != Notification.NO_INDEX) {
> list.remove(notification.getPosition());
> } else {
> list.remove(replaceValue(notification.getOldValue(), eFeature));
> }
> }
> if (map != null) {
> final Map.Entry<?, ?> entry = (Map.Entry<?, ?>)
> notification.getNewValue();
> map.remove(entry.getKey());
> }
> break;
>
>
> I suggest, that the line getting the Map.Entry should call
> notification.getOldValue() instead of notification.getNewValue(). The
> new value is null and thus causes a NullPointerException at map.remove().
>
> Could somebody please verify this? Am I missing something?
>
> Thanks,
> Roland
>
>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] NPE in PersistentStoreAdapter [message #138197 is a reply to message #138190] Wed, 08 July 2009 08:47 Go to previous messageGo to next message
Roland Brand is currently offline Roland BrandFriend
Messages: 42
Registered: July 2009
Member
Hi Martin

I just filed bug 282795 for this. Thank you for your extremely fast answer.

Greets,
Roland
Re: [Teneo] NPE in PersistentStoreAdapter [message #138203 is a reply to message #138197] Wed, 08 July 2009 10:40 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Roland,
And to add to the very-fast-feeling. I did a build 5 minutes ago which contains a change for this:
http://www.eclipse.org/modeling/emf/downloads/?project=teneo &showAll=1&hlbuild=M200907080536#M200907080536

I backported this very-small fix to 1.0.4 which I will build later in the afternoon.

btw, support for Teneo is given on the main EMF newsgroup which I added as cc.

gr. Martin

Roland Brand wrote:
> Hi Martin
>
> I just filed bug 282795 for this. Thank you for your extremely fast answer.
>
> Greets,
> Roland
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] NPE in PersistentStoreAdapter [message #621101 is a reply to message #138183] Wed, 08 July 2009 08:13 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Roland,
Afaics you are completely correct. Can you enter a bugzilla for this? Then I will pick this up in the next build which
will be today or tomorrow (after I solved this).

gr. Martin

Roland Brand wrote:
> Hi
>
> I'm using Teneo with Hibernate and just upgraded from Teneo 1.0.0 to
> Teneo 1.1.0. When testing my code I ran into a Problem when removing
> entries from a map.
>
> Stepping down with the debugger, I suspect Line 137 of
> org.eclipse.emf.teneo.type.PersistentStoreAdapter to be wrong. Here is a
> short excerpt:
>
> case Notification.REMOVE:
> if (list != null) {
> if (notification.getPosition() != Notification.NO_INDEX) {
> list.remove(notification.getPosition());
> } else {
> list.remove(replaceValue(notification.getOldValue(), eFeature));
> }
> }
> if (map != null) {
> final Map.Entry<?, ?> entry = (Map.Entry<?, ?>)
> notification.getNewValue();
> map.remove(entry.getKey());
> }
> break;
>
>
> I suggest, that the line getting the Map.Entry should call
> notification.getOldValue() instead of notification.getNewValue(). The
> new value is null and thus causes a NullPointerException at map.remove().
>
> Could somebody please verify this? Am I missing something?
>
> Thanks,
> Roland
>
>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] NPE in PersistentStoreAdapter [message #621102 is a reply to message #138190] Wed, 08 July 2009 08:47 Go to previous message
Roland Brand is currently offline Roland BrandFriend
Messages: 42
Registered: July 2009
Member
Hi Martin

I just filed bug 282795 for this. Thank you for your extremely fast answer.

Greets,
Roland
Re: [Teneo] NPE in PersistentStoreAdapter [message #621103 is a reply to message #138197] Wed, 08 July 2009 10:40 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Roland,
And to add to the very-fast-feeling. I did a build 5 minutes ago which contains a change for this:
http://www.eclipse.org/modeling/emf/downloads/?project=teneo &showAll=1&hlbuild=M200907080536#M200907080536

I backported this very-small fix to 1.0.4 which I will build later in the afternoon.

btw, support for Teneo is given on the main EMF newsgroup which I added as cc.

gr. Martin

Roland Brand wrote:
> Hi Martin
>
> I just filed bug 282795 for this. Thank you for your extremely fast answer.
>
> Greets,
> Roland
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[Teneo] NPE in PersistentStoreAdapter
Next Topic:[EMF Compare] Conflicting should be true, but is false
Goto Forum:
  


Current Time: Thu Feb 29 23:06:50 GMT 2024

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

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

Back to the top