[Teneo] NPE in PersistentStoreAdapter [message #138183] |
Wed, 08 July 2009 03:59  |
Eclipse User |
|
|
|
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 04:13   |
Eclipse User |
|
|
|
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 #621101 is a reply to message #138183] |
Wed, 08 July 2009 04:13  |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03549 seconds