| Summary: | Generated EMF editors shows stale data | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Stefan Edlund <sedlund> |
| Component: | Core | Assignee: | Ed Merks <Ed.Merks> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mattadav, sedlund |
| Version: | 2.7.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Stefan Edlund
The fix is committed to CVS for 2.7. The changes are available in EMF 2.7 M7 or an earlier build. Adding to existing bug, as this is related to the initial fix. If you'd prefer it opened in a new bug, please let me know. Thanks. --- After switching from EMF 2.6 to EMF 2.7, when opening an editor on a model with unresolved proxies, a NoSuchElementException (AbstractEList.java:717) is thrown and caught by the UI. The root cause, however, is an IndexOutOfBoundsException as seen in this stack trace: Daemon Thread [Thread-1] (Suspended (exception org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException)) org.eclipse.emf.common.util.BasicEList<E>.get(int) line: 352 org.eclipse.emf.edit.provider.ItemProviderAdapter$ChildrenStore.get(org.eclipse.emf.ecore.EStructuralFeature, int) line: 2217 org.eclipse.stem.core.scenario.provider.ScenarioItemProvider(org.eclipse.emf.edit.provider.ItemProviderAdapter).updateChildren(org.eclipse.emf.common.notify.Notification) line: 2577 org.eclipse.stem.core.scenario.provider.ScenarioItemProvider.notifyChanged(org.eclipse.emf.common.notify.Notification) line: 167 org.eclipse.stem.core.scenario.impl.ScenarioImpl(org.eclipse.emf.common.notify.impl.BasicNotifierImpl).eNotify(org.eclipse.emf.common.notify.Notification) line: 380 org.eclipse.emf.ecore.util.EObjectResolvingEList<E>(org.eclipse.emf.ecore.util.EcoreEList<E>).dispatchNotification(org.eclipse.emf.common.notify.Notification) line: 255 org.eclipse.emf.ecore.util.EObjectResolvingEList<E>(org.eclipse.emf.ecore.util.EcoreEList<E>).resolve(int, org.eclipse.emf.ecore.EObject) line: 192 org.eclipse.emf.ecore.util.EObjectResolvingEList<E>.resolve(int, E) line: 66 org.eclipse.emf.ecore.util.EObjectResolvingEList<E>(org.eclipse.emf.common.util.BasicEList<E>).get(int) line: 354 org.eclipse.emf.common.util.AbstractEList$EIterator<E1>.doNext() line: 709 org.eclipse.emf.common.util.AbstractEList$EIterator<E1>.next() line: 696 org.eclipse.stem.core.scenario.provider.ScenarioItemProvider(org.eclipse.emf.edit.provider.ItemProviderAdapter).getChildren(java.lang.Object) line: 366 org.eclipse.stem.core.scenario.provider.ScenarioItemProvider(org.eclipse.emf.edit.provider.ItemProviderAdapter).hasChildren(java.lang.Object, boolean) line: 423 org.eclipse.stem.core.scenario.provider.ScenarioItemProvider(org.eclipse.emf.edit.provider.ItemProviderAdapter).hasChildren(java.lang.Object) line: 410 ... org.eclipse.jface.viewers.TreeViewer(org.eclipse.jface.viewers.StructuredViewer).setInput(java.lang.Object) line: 1690 org.eclipse.stem.core.scenario.presentation.ScenarioEditor.createPages() line: 943 org.eclipse.stem.core.scenario.presentation.ScenarioEditor(org.eclipse.ui.part.MultiPageEditorPart).createPartControl(org.eclipse.swt.widgets.Composite) line: 348 ... The addition of Notification.RESOLVE falling into Notification.SET to the switch in ItemProviderAdapter.updateChildren(...) is the difference between EMF 2.6.x and 2.7.0 that appears to be causing this. Remove dependency on STEM bug 329503 since we now have a fix for the danger of losing edits. However, we are still blocked from moving to EMF 2.7 in STEM due to the exception reported by Matt below. I created a test case to reproduce the problem and then fixed it by guarding RESOLVE to avoid updating in the case where there is no child to update at the notification index. I've committed fixes to git for 2.8 and 2.7.2. The changes are available in the M6 build. |