Bug 536120 - NPE when closing a modeling project
Summary: NPE when closing a modeling project
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 6.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-06-21 04:42 EDT by Florian Barbin CLA
Modified: 2018-11-19 11:30 EST (History)
1 user (show)

See Also:


Attachments
Use case to reproduce (4.40 KB, application/zip)
2018-06-21 04:42 EDT, Florian Barbin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Barbin CLA 2018-06-21 04:42:08 EDT
Created attachment 274566 [details]
Use case to reproduce

Steps to reproduce:
* Import the attached project
* Open the Tree representation
* Perform a Ctrl+o and select the last not in the hierarchy
* The representation becomes dirty
* Close the modeling project without saving
* The following NPE occurs:

java.lang.NullPointerException
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.didRemove(BasicNotifierImpl.java:146)
	at org.eclipse.emf.common.util.AbstractEList.didClear(AbstractEList.java:170)
	at org.eclipse.emf.common.util.BasicEList.clear(BasicEList.java:639)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapterList.clear(BasicNotifierImpl.java:235)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.disableAndRemoveECrossReferenceAdapters(DAnalysisSessionImpl.java:316)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.close(DAnalysisSessionImpl.java:1280)
	at org.eclipse.sirius.business.internal.session.danalysis.SessionResourcesSynchronizer.processAction(SessionResourcesSynchronizer.java:168)
	at org.eclipse.sirius.business.internal.session.danalysis.SessionResourcesSynchronizer.statusesChanged(SessionResourcesSynchronizer.java:108)
	at org.eclipse.sirius.common.tools.api.resource.ResourceSetSync.notifyClientsInBatch(ResourceSetSync.java:392)
	at org.eclipse.sirius.common.tools.api.resource.ResourceSetSync.statusesChanged(ResourceSetSync.java:447)
	at org.eclipse.sirius.common.tools.internal.resource.ResourceSyncClientNotifier.run(ResourceSyncClientNotifier.java:78)
	at org.eclipse.sirius.common.tools.internal.resource.EditingSessionWorkspaceListener.resourceChanged(EditingSessionWorkspaceListener.java:59)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:297)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:287)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:150)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:376)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1499)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:46)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Comment 1 Pierre-Charles David CLA 2018-06-21 09:57:53 EDT
(In reply to Florian Barbin from comment #0)
> Created attachment 274566 [details]
> Use case to reproduce
> 
> Steps to reproduce:
> * Import the attached project
> * Open the Tree representation
> * Perform a Ctrl+o and select the last not in the hierarchy

What do you mean by "the last not in the hierarchy"?
Comment 2 Florian Barbin CLA 2018-06-21 10:12:42 EDT
(In reply to Pierre-Charles David from comment #1)
> (In reply to Florian Barbin from comment #0)
> > Created attachment 274566 [details]
> > Use case to reproduce
> > 
> > Steps to reproduce:
> > * Import the attached project
> > * Open the Tree representation
> > * Perform a Ctrl+o and select the last not in the hierarchy
> 
> What do you mean by "the last not in the hierarchy"?

Oups, The last item.
Comment 3 Pierre-Charles David CLA 2018-11-19 11:30:16 EST
On 6.1.1 I get a slightly different stack (at the top of the stack at least):

java.util.ConcurrentModificationException
	at org.eclipse.emf.common.util.AbstractEList$EIterator.checkModCount(AbstractEList.java:760)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:708)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:694)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.disableAndRemoveECrossReferenceAdapters(DAnalysisSessionImpl.java:316)
	at org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl.close(DAnalysisSessionImpl.java:1282)
	at org.eclipse.sirius.business.internal.session.danalysis.SessionResourcesSynchronizer.processAction(SessionResourcesSynchronizer.java:170)
	at org.eclipse.sirius.business.internal.session.danalysis.SessionResourcesSynchronizer.statusesChanged(SessionResourcesSynchronizer.java:110)
	at org.eclipse.sirius.common.tools.api.resource.ResourceSetSync.notifyClientsInBatch(ResourceSetSync.java:394)
	at org.eclipse.sirius.common.tools.api.resource.ResourceSetSync.statusesChanged(ResourceSetSync.java:449)
	at org.eclipse.sirius.common.tools.internal.resource.ResourceSyncClientNotifier.run(ResourceSyncClientNotifier.java:80)
	at org.eclipse.sirius.common.tools.internal.resource.EditingSessionWorkspaceListener.resourceChanged(EditingSessionWorkspaceListener.java:61)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:299)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:289)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:152)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:374)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1469)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:46)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

The line in question (which triggers the CME), is "for (Resource resource : resourceSet.getResources()) {"