Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMFStore] IndexOutOfBoundsException when adding EClass object to EReference feature
[EMFStore] IndexOutOfBoundsException when adding EClass object to EReference feature [message #1396853] Tue, 08 July 2014 22:11 Go to next message
Olivier Labrosse is currently offline Olivier LabrosseFriend
Messages: 49
Registered: November 2011
Member
Hi,

We have a model, stored in EMFStore, at the root of the ECPProject. In it we have a certain EObject that has a non-containment EReference with an EClass reference type. When we try to add an EClass that comes from a platform ecore, we get the following IndexOutOfBoundsException:

!ENTRY org.eclipse.emf.emfstore.common.model 2 2 2014-07-08 16:13:31.274
!MESSAGE EObject Change Observer threw an exception: org.eclipse.emf.emfstore.internal.client.model.impl.OperationManager
!STACK 0
java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
    at java.util.ArrayList.rangeCheck(ArrayList.java:635)
    at java.util.ArrayList.get(ArrayList.java:411)
    at org.eclipse.emf.emfstore.internal.client.model.impl.OperationRecorder.createCreateDeleteOperation(OperationRecorder.java:421)
    at org.eclipse.emf.emfstore.internal.client.model.impl.OperationRecorder.modelElementAdded(OperationRecorder.java:217)
    at org.eclipse.emf.emfstore.internal.client.model.impl.OperationManager.modelElementAdded(OperationManager.java:259)
    at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl$1.run(NotifiableIdEObjectCollectionImpl.java:108)
    at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl$2.run(NotifiableIdEObjectCollectionImpl.java:142)
    at org.eclipse.emf.emfstore.common.ESSafeRunner.run(ESSafeRunner.java:38)
    at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl.notifyIdEObjectCollectionChangeObservers(NotifiableIdEObjectCollectionImpl.java:165)
    at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl.modelElementAdded(NotifiableIdEObjectCollectionImpl.java:111)
    at org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.addAdapter(EObjectChangeNotifier.java:90)
    at org.eclipse.emf.ecore.util.EContentAdapter.handleContainment(EContentAdapter.java:139)
    at org.eclipse.emf.ecore.util.EContentAdapter.selfAdapt(EContentAdapter.java:74)
    at org.eclipse.emf.ecore.util.EContentAdapter.notifyChanged(EContentAdapter.java:40)
    at org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.notifyChanged(EObjectChangeNotifier.java:187)
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
    at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1027)
    at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
    at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:299)
    at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:303)
    at org.eclipse.emf.emfstore.internal.common.model.impl.ProjectImpl.addCutElement(ProjectImpl.java:244)
    at org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.handleSingleReference(EObjectChangeNotifier.java:258)
    at org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.notifyChanged(EObjectChangeNotifier.java:196)
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
    at org.eclipse.emf.ecore.util.DelegatingEcoreEList.dispatchNotification(DelegatingEcoreEList.java:355)
    at org.eclipse.emf.common.notify.impl.DelegatingNotifyingListImpl.addUnique(DelegatingNotifyingListImpl.java:296)
    at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:303)
...


Would anybody have a clear idea as to why this is happening? I could give more information tomorrow morning (EST here); I'm just not sure what kind of information would be helpful here.

Thanks very much for your help.

Regards,
Olivier

EDIT: just noticed I missed a few important lines from the stack trace. Notice the addCutElement() call.

[Updated on: Tue, 08 July 2014 22:24]

Report message to a moderator

Re: [EMFStore] IndexOutOfBoundsException when adding EClass object to EReference feature [message #1396867 is a reply to message #1396853] Tue, 08 July 2014 22:43 Go to previous messageGo to next message
Olivier Labrosse is currently offline Olivier LabrosseFriend
Messages: 49
Registered: November 2011
Member
Ok, after a quick look at some of the code, I realized the org.eclipse.emf.emfstore.ecore plugin isn't in our target platform. With it, the EClass object should not be added to the "cut elements" due to being a singleton, thus this whole issue should then be prevented.

Any reason why this plugin wouldn't be installed when installing the EMFStore SDK from the p2 repo? I'm thinking it's rather important, no?

Tomorrow morning I'll be able to test this and report on my findings.

Regards,
Olivier
Re: [EMFStore] IndexOutOfBoundsException when adding EClass object to EReference feature [message #1397959 is a reply to message #1396867] Thu, 10 July 2014 11:59 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

thanks for pointing this out. I agree, that it should probably be part
of the SDK, could you open a BR for this, plz?

Best Regards

Jonas

Am 09.07.2014 00:43, schrieb Olivier Labrosse:
> Ok, after a quick look at some of the code, I realized the
> org.eclipse.emf.emfstore.ecore plugin isn't in our target platform.
> With it, the EClass object should not be added to the "cut elements" due
> to being a singleton, thus this whole issue should then be prevented.
>
> Any reason why this plugin wouldn't be installed when installing the
> EMFStore SDK from the p2 repo? I'm thinking it's rather important, no?
>
> Tomorrow morning I'll be able to test this and report on my findings.
>
> Regards,
> Olivier
Re: [EMFStore] IndexOutOfBoundsException when adding EClass object to EReference feature [message #1398030 is a reply to message #1397959] Thu, 10 July 2014 14:01 Go to previous message
Olivier Labrosse is currently offline Olivier LabrosseFriend
Messages: 49
Registered: November 2011
Member
Done. BR: https://bugs.eclipse.org/bugs/show_bug.cgi?id=439349

And I apologize for not getting back with my test results yesterday. It so happens this was the solution to our problem, adding the org.eclipse.emf.emfstore.ecore plugin to our target platform.

Regards,
Olivier

Jonas Helming wrote on Thu, 10 July 2014 07:59
Hi,

thanks for pointing this out. I agree, that it should probably be part
of the SDK, could you open a BR for this, plz?

Best Regards

Jonas

Am 09.07.2014 00:43, schrieb Olivier Labrosse:
> Ok, after a quick look at some of the code, I realized the
> org.eclipse.emf.emfstore.ecore plugin isn't in our target platform.
> With it, the EClass object should not be added to the "cut elements" due
> to being a singleton, thus this whole issue should then be prevented.
>
> Any reason why this plugin wouldn't be installed when installing the
> EMFStore SDK from the p2 repo? I'm thinking it's rather important, no?
>
> Tomorrow morning I'll be able to test this and report on my findings.
>
> Regards,
> Olivier

Previous Topic:Security scan issues
Next Topic:[ECP] View validation with OCL constraints
Goto Forum:
  


Current Time: Mon Mar 08 17:23:25 GMT 2021

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

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

Back to the top