Community
Participate
Working Groups
Created attachment 241977 [details] Exceptions in the log Papyrus 1.0 (Luna post M6) Git master as of commit 142f6b5. In trying to reproduce bug 432737, I ran into exceptions in the automatic closing and re-opening of models that have a profile applied that needs migration. The exceptions are of two kinds: an IllegalStateException ("need write transaction to modify the model") and a ConcurrentModificationException (in the applied-stereotypes collections cached in the CacheAdapter). Both bomb the re-loading of the resource, but nonetheless these models are then leaked in their entirety in the CacheAdapter for the remainder of the Eclipse session. Curiously, the EMF Transaction editing-domain correctly diagnoses the problem as stemming from accidental proxy resolution during resource unload: the ProxyModificationTrackingAdapter is the culprit in both cases. Steps to reproduce: (as in bug 432737) 1. Create and define a profile containing some stereotypes. 2. Apply the profile and one of its stereotypes (the same stereotype) in two models. 3. Save the models. 4. In the profile, change the name of the stereotype applied in step 2 to the models. Make sure the name is different than before. 5. Save and define the profile. 6. See the two models from step 2 closed and re-opened. 7. Let Papyrus re-apply the profile in both models when prompted (twice). 8. Save the models. 9. Look in the workspace log and see exceptions like those attached.
I have pushed a Gerrit review: https://git.eclipse.org/r/24987 This fixes the exceptions by updating the ProxyModificationTrackingAdapter to process added/removed contents only when the resource is loaded. This ensures that it does not process objects that are removed because the resource is unloaded, which is what triggers the exceptions and consequent symptoms in the editor.
The Gerrit change has been merged to master.