Community
Participate
Working Groups
Build Identifier: cdo 2.0 Appeared on listening object changes with CDOAdapter. Transaction delivered feature delta to server : CDOFeatureDelta[versions, LIST, list=[CDOFeatureDelta[versions, CLEAR], CDOFeatureDelta[versions, ADD, value=OID147, index=0], CDOFeatureDelta[versions, ADD, value=NULL, index=1], CDOFeatureDelta[versions, REMOVE, index=1], CDOFeatureDelta[versions, ADD, value=OID150, index=1]]] But on another client, in attempt to convert delta to the Notification, NPE was thrown: java.lang.NullPointerException at org.eclipse.emf.common.notify.impl.NotificationImpl.merge(NotificationImpl.java:836) at org.eclipse.emf.common.notify.impl.NotificationImpl.add(NotificationImpl.java:1000) at org.eclipse.emf.common.notify.impl.NotificationImpl.add(NotificationImpl.java:1020) at org.eclipse.emf.internal.cdo.CDONotificationBuilder.add(CDONotificationBuilder.java:117) at org.eclipse.emf.internal.cdo.CDONotificationBuilder.visit(CDONotificationBuilder.java:72) at org.eclipse.emf.cdo.internal.common.revision.delta.CDORemoveFeatureDeltaImpl.accept(CDORemoveFeatureDeltaImpl.java:72) at org.eclipse.emf.internal.cdo.CDONotificationBuilder.visit(CDONotificationBuilder.java:92) at org.eclipse.emf.cdo.internal.common.revision.delta.CDOListFeatureDeltaImpl.accept(CDOListFeatureDeltaImpl.java:215) at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.accept(CDORevisionDeltaImpl.java:227) at org.eclipse.emf.internal.cdo.CDONotificationBuilder.buildNotification(CDONotificationBuilder.java:52) at org.eclipse.emf.internal.cdo.view.CDOViewImpl.handleChangeSubscription(CDOViewImpl.java:1321) Reproducible: Always
CDOClearFeatureDelta is created as CDODeltaNotificationImpl with event NotificationImpl.REMOVE_MANY and new value of this event is passed *null*. Merge code is expecting to receive array of removed indexes. Hence any other event of type NotificationImpl.REMOVE will rise NPE on merge code.
I think that REMOVE action shouldn't be merged with REMOVE_MANY action. If this REMOVE_MANY was originated from feature delta CLEAR.
Created attachment 165388 [details] Patch I would prefer to add concept in EMF like REMOVE_ALL, but here is fix in CDO code.
Hi Egidijus, Thanks for the patch! Can you please confirm the following: 1) The number of lines that you changed is smaller than 250. 2) You are the only author of these changed lines. 3) You apply the EPL to these changed lines.
(In reply to comment #4) > 1) The number of lines that you changed is smaller than 250. Yes, it is obvious :) > 2) You are the only author of these changed lines. Yes > 3) You apply the EPL to these changed lines. Yes
Obvious for you and me, but for the lawyers?! :P Committed to R2_0_maintenance
Available in 2.0.2: https://build.eclipse.org/hudson/job/emf-cdo-maintenance/44/artifact/result/site.p2/