The previous commit (1f4402943) completely disabled EMF's default getEObjectByID in favor of using our own JSONResourceImpl-specific id map. However there are cases where we still want to lookup elements by their intrinsic (modeled) id instead of the IDManager-provided one, without incurring the cost of an eAllContents() on failure.
This change allows for this to work, as long as the JSONResourceImpl has been setup with a non-null intrinsicIDToEObjectMap. For example right after the resource creation:
Once this is done, any new object added to the resource will get its intrinsic id cached in this map (see ResourceImpl.attachedHelper()) and JsonResourceImpl.getEObjectById will find it there (if present) while still bypassing the whole eAllContents() search in super.getEObjectByID(id).
The previous commit (1f4402943) completely disabled EMF's default
getEObjectByID
in favor of using our ownJSONResourceImpl
-specific id map. However there are cases where we still want to lookup elements by their intrinsic (modeled) id instead of theIDManager
-provided one, without incurring the cost of an eAllContents() on failure.This change allows for this to work, as long as the
JSONResourceImpl
has been setup with a non-nullintrinsicIDToEObjectMap
. For example right after the resource creation:Once this is done, any new object added to the resource will get its intrinsic id cached in this map (see
ResourceImpl.attachedHelper()
) andJsonResourceImpl.getEObjectById
will find it there (if present) while still bypassing the wholeeAllContents()
search insuper.getEObjectByID(id)
.Bug: https://github.com/eclipse-sirius/sirius-emf-json/issues/41