eclipse-ecp / org.eclipse.emf.ecp.core

Eclipse Public License 2.0
0 stars 0 forks source link

BasicIndexOutOfBoundsException is thrown by MultiAttributeSWTRenderer when entering the same data twice. #61

Open eclipse-ecp-bot opened 9 months ago

eclipse-ecp-bot commented 9 months ago

| --- | --- | | Bugzilla Link | 528257 | | Status | NEW | | Importance | P3 normal | | Reported | Dec 07, 2017 06:59 EDT | | Modified | Aug 16, 2023 13:03 EDT | | Version | 1.15.0 | | Reporter | Tamas Miklossy |

Description

Created attachment 271806\ screen cast showing the problem

Reproducible with "EMF Forms SDK 1.15.0.20171204-2237"

Step to reproduce (see also the screencast.gif attachment):

  1. Modify the task.ecore model in the makeithappen example project to allow a user having more than once first name.
  2. EMFForms renders the firstName feature of the User class with the MultiAttributeSWTRenderer.
  3. Add a new row to the firstname tabel and enter 'a'.
  4. Add a new row again to the firstname tabel and enter 'a' again.
  5. A BasicIndexOutOfBoundsException is thrown.

org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=1, size=1\ at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346)\ at java.util.Collections$UnmodifiableList.get(Collections.java:1309)\ at org.eclipse.core.internal.databinding.property.list.SimplePropertyObservableList.set(SimplePropertyObservableList.java:450)\ at org.eclipse.core.databinding.observable.list.DecoratingObservableList.set(DecoratingObservableList.java:224)\ at org.eclipse.emf.ecp.edit.internal.swt.util.ECPObservableValue.doSetValue(ECPObservableValue.java:71)\ at org.eclipse.core.databinding.observable.value.AbstractObservableValue.setValue(AbstractObservableValue.java:66)\ at org.eclipse.core.databinding.UpdateValueStrategy.doSet(UpdateValueStrategy.java:469)\ at org.eclipse.core.databinding.ValueBinding$3$1.run(ValueBinding.java:210)\ at org.eclipse.core.databinding.observable.Realm$1.run(Realm.java:149)\ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)\ at org.eclipse.core.databinding.observable.Realm.safeRun(Realm.java:153)\ at org.eclipse.core.databinding.observable.Realm.exec(Realm.java:171)\ at org.eclipse.core.databinding.ValueBinding$3.run(ValueBinding.java:200)\ at org.eclipse.core.databinding.observable.Realm$1.run(Realm.java:149)\ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)\ at org.eclipse.core.databinding.observable.Realm.safeRun(Realm.java:153)\ at org.eclipse.core.databinding.observable.Realm.exec(Realm.java:171)\ at org.eclipse.core.databinding.ValueBinding.doUpdate(ValueBinding.java:162)\ at org.eclipse.core.databinding.ValueBinding.updateTargetToModel(ValueBinding.java:122)\ at org.eclipse.emfforms.spi.view.control.multiattribute.MultiAttributeSWTRenderer$ECPListEditingSupport.saveCellEditorValue(MultiAttributeSWTRenderer.java:932)\ at org.eclipse.jface.viewers.ColumnViewerEditor.saveEditorValue(ColumnViewerEditor.java:433)\ at org.eclipse.jface.viewers.ColumnViewerEditor.applyEditorValue(ColumnViewerEditor.java:299)\ at org.eclipse.jface.viewers.ColumnViewerEditor$1.applyEditorValue(ColumnViewerEditor.java:152)\ at org.eclipse.jface.viewers.CellEditor$1.run(CellEditor.java:332)\ at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)\ at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:44)\ at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)\ at org.eclipse.jface.viewers.CellEditor.fireApplyEditorValue(CellEditor.java:329)\ at org.eclipse.jface.viewers.TextCellEditor.handleDefaultSelection(TextCellEditor.java:283)\ at org.eclipse.jface.viewers.TextCellEditor.lambda$0(TextCellEditor.java:143)\ at org.eclipse.swt.events.SelectionListener$2.widgetDefaultSelected(SelectionListener.java:99)\ at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:120)\ at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)\ at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)\ at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)\ at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)\ at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)\ at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)\ at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)\ at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044)\ at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)\ at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)\ at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)\ at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)\ at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)\ at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)\ at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)\ at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)\ at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)\ at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)\ at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)\ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\ at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\ at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\ at java.lang.reflect.Method.invoke(Method.java:498)\ at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)\ at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)\ at org.eclipse.equinox.launcher.Main.run(Main.java:1499)\ at org.eclipse.equinox.launcher.Main.main(Main.java:1472)

screencast.gif

screencast.gif

eclipse-ecp-bot commented 9 months ago

By Eugen Neufeld on Dec 07, 2017 11:04

Thank you for the report. We will take a look at this.

Does this also happen if you use the MultiAttribute Renderer which is provided by the "EMF Forms SWT Control for Multi EAttribtues" Feature?

Cheers,\ Eugen

eclipse-ecp-bot commented 9 months ago

By Tamas Miklossy on Jan 15, 2018 08:28

The problem occurs when using the org.eclipse.emfforms.spi.view.control.multiattribute.MultiAttributeSWTRenderer class.

As far as I can see, this class is provided by the org.eclipse.emfforms.swt.control.multiattribute.feature.

eclipse-ecp-bot commented 9 months ago

By Eugen Neufeld on Jan 16, 2018 05:01

Thank you, we will check this.

It looks like this is an issue with handling unique lists.

Cheers,\ Eugen

eclipse-ecp-bot commented 9 months ago

By Eugen Neufeld on Mar 02, 2018 02:58

We're happy to accept a contribution.

Moving to next milestone as we will not have time to fix this for 1.16.

eclipse-ecp-bot commented 9 months ago

By Eugen Neufeld on Aug 22, 2018 09:35

Mass Move due to time constraints

eclipse-ecp-bot commented 9 months ago

By Tamas Miklossy on Sep 13, 2018 09:47

Yes, the exception occurs only if the list in the meta-model is configured as unique.

eclipse-ecp-bot commented 9 months ago

By Eugen Neufeld on Nov 06, 2018 04:30

We won't be able to fix this for 1.19. We would be very happy to accept a contribution for this though.

eclipse-ecp-bot commented 9 months ago

Aug 25, 2021 09:54

This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--\ The automated Eclipse Genie.

eclipse-ecp-bot commented 9 months ago

Aug 16, 2023 13:03

This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--\ The automated Eclipse Genie.