viatra / EMF-IncQuery

This repository is only kept for historic reasons. All development happens on eclipse.org
http://eclipse.org/viatra
13 stars 4 forks source link

Inconsistent Query Explorer state after closing UML graphical editor #347

Closed abelhegedus closed 11 years ago

abelhegedus commented 11 years ago

When loading an UML model from the graphical Papyrus editor and loading some queries that match on UML models, the Query Explorer sometimes fails to remove the entry for the model when the editor is closed.

This was reported as part of #337

I have reproduced this with the newest version of Papyrus, UML and EIQ on the UML example from the EIQ-examples repository.

The matchers under the entry sometimes show "No matches" after closing and sometimes there are even some matches remaining (but not all).

In the background, EIQ-BASE and EIQ are putting exceptions in the error log:

EMF-IncQuery encountered an error in processing the EMF model. This happened while trying to remove the object: org.eclipse.uml2.uml.internal.impl.ClassImpl@4998cf28 (name: E, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false)
Stack trace: java.lang.NullPointerException

and

EMF-IncQuery Base encountered an error while traversing the EMF model to gather new information. 
java.lang.NullPointerException
okrosa commented 11 years ago

I can reproduce the error deterministically with the model.di file. (I only tried the model.uml according to the #337 ticket.) I try to look into it, but it is a bit hard, as the rete is blurting out 100+ error.

abelhegedus commented 11 years ago

I think the number of errors is of no relevance, the important part is to make sure that the user interface is cleared before throwing out the engine. Or altenratively make sure that exceptions thrown during engine disposal don't affect the Query Explorer entry removal.

okrosa commented 11 years ago

http://www.quickmeme.com/meme/3rkfbk/ :-)

okrosa commented 11 years ago

Problem solved, the GMFEditorPartListener needed to be extended so Papyrus models can be unloaded properly. This error is actually connected to the #318 issue, where we needed a similar change for loading as well.

istvanrath commented 11 years ago

@okrosa please cherrypick this into the maintenance branch

okrosa commented 11 years ago

Cherry pick completed.