Community
Participate
Working Groups
The ControlledResourceTracker may throw a NPE on rollback. The situation is that several resources were added during a transaction. One Resource was added that contained an object (Document) which itself was contained in another container (Project) (so we have a cross resource containment here). In this situation a rollback occured and the NPE is thrown in the below code snipped because container.eResource() is null. - oldRoot is the Document which was removed from the resource - container resolves to the project (which was contained in a different Resource. At the point of NPE the project has already been removed from its own resource) protected void handleRemove(Resource resource, EObject oldRoot) { InternalEObject container = ((InternalEObject) oldRoot).eInternalContainer(); if (container != null) { // Found cross-resource containment URI parentURI = container.eIsProxy() ? container.eProxyURI().trimFragment() : container.eResource().getURI(); if (parentURI != null) { unmap(resource.getURI(), parentURI); } } }
Just to clarify: we use papyrus with our own models which we store in the same ResourceSet. An option to "not track" our own resources would also be nice because I think there is no need for the ResourceTracker to track these resources at all.