Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324544

Summary: IndexOutOfBoundsException on sending delta notifications
Product: [Modeling] EMF Reporter: Egidijus Vaisnora <vaisegid>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: major    
Priority: P3 CC: cyril.jaquier, erwin
Version: 4.2   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
test case attached none

Description Egidijus Vaisnora CLA 2010-09-06 02:44:59 EDT
Invoking session refresh causes exception

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.get(BaseCDORevision.java:409)
	at org.eclipse.emf.internal.cdo.CDONotificationBuilder.visit(CDONotificationBuilder.java:137)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDORemoveFeatureDeltaImpl.accept(CDORemoveFeatureDeltaImpl.java:74)
	at org.eclipse.emf.internal.cdo.CDONotificationBuilder.visit(CDONotificationBuilder.java:192)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDOListFeatureDeltaImpl.accept(CDOListFeatureDeltaImpl.java:410)
	at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.accept(CDORevisionDeltaImpl.java:284)
	at org.eclipse.emf.internal.cdo.CDONotificationBuilder.buildNotification(CDONotificationBuilder.java:102)
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.sendDeltaNotifications(CDOViewImpl.java:1633)
	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.invalidate(CDOViewImpl.java:1479)
	at org.eclipse.emf.internal.cdo.session.CDOSessionImpl.processRefreshSessionResult(CDOSessionImpl.java:568)
	at org.eclipse.emf.internal.cdo.session.CDOSessionImpl.refresh(CDOSessionImpl.java:529)
	at org.eclipse.emf.internal.cdo.session.CDOSessionImpl.refresh(CDOSessionImpl.java:500)
Comment 1 Egidijus Vaisnora CLA 2010-09-06 02:52:35 EDT
Created attachment 178238 [details]
test case attached

test case illustrating exception
Comment 2 Egidijus Vaisnora CLA 2010-09-06 03:09:08 EDT
Idea is that I have two users and both are editing the same list feature - bot are adding an element. First user commits changes and second one makes refresh.
Comment 3 Egidijus Vaisnora CLA 2010-09-06 03:30:04 EDT
Originally user 2 is in conflict state in this situation. However strange is that change notification is fired before handling conflicts. It would be situation, when conflict is resolved to the different values, than it got fired. More ever, created delta for second user is odd - list delta has two deltas REMOVE and ADD, regardless that on server was originally executed ADD action.
Comment 4 Erwin Betschart CLA 2010-09-06 11:51:52 EDT
(In reply to comment #3)
> Originally user 2 is in conflict state in this situation. However strange is
> that change notification is fired before handling conflicts....

Afaik this is already fixed on head (4.0.0). The conflics are resolved before the notification is built up.
Comment 5 Egidijus Vaisnora CLA 2010-09-07 02:46:34 EDT
Looks like fix in head was for https://bugs.eclipse.org/bugs/show_bug.cgi?id=316887.
Comment 6 Eike Stepper CLA 2010-11-16 01:03:24 EST
Changing version to 3.0.

Let's only use major versions to indicate the development stream. If more precise baseline info is needed let's insert a time stamp in a comment.
Comment 7 Eike Stepper CLA 2011-06-23 04:27:53 EDT
Moving all open problem reports to 4.0
Comment 8 Eike Stepper CLA 2012-06-05 07:31:05 EDT
Moving all open bug reports to 4.1 because the release is very near and it's hghly unlikely that there will be spare time to address 4.0 problems.

Please make sure that your patches can be applied against the master branch and that your problem is not already fixed there!!!
Comment 9 Eike Stepper CLA 2012-08-14 22:54:19 EDT
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
Comment 10 Eike Stepper CLA 2012-10-31 07:34:50 EDT
The attached test case passes and I've committed it. The original problem has likely been fixed via some other bug during the years.
Comment 11 Eike Stepper CLA 2013-06-27 03:33:59 EDT
Available in R20130613-1157 (4.2)