Community
Participate
Working Groups
This behaviour was seen using InMemoryEmfModel. After executing a module, I call "unload" in the wrapped EMF Resource, which causes a "Type Not found" exception. Looking at the stack trace, the issue is that the "CachedContentsAdapter" is still attached to the Resource and the unloading causes the type not found error. Calling dispose on the modelRepository did not solve the issue. I propose that the adapters are removed in the EmfModel dispose implementation so that disposing the model (or the model repository) would effectively removed any attached adapters. IMHO, in the particular case of InMemoryEmfModels, an alternative mechanism should be used for the cache, as (potentially) the resource is used elsewhere and attaching adapters can create hard to track issues in the future. On a side note, why does a missing type prints the stack trace on the console but does not generate an exception? It is counter intuitive to see errors in the console but execution still completes correctly.
Thanks for reporting this Horacio. Could you please share a minimal example / unit test I can use to reproduce this?