xwiki/xwiki-commons — comment on commit 7deda9c10f35ad7056e928cecc298269616aabe3
File: xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/embed/EmbeddableComponentManager.java line 267
By dgervalle:

I do not agree with this change.
What I was doing is basically re-registering the same descriptor without an instance, which has the following side effect:
- remove the current instance and call its dispose() if needed
- fire an unregistration event, to tell the world that this reference is now dead
- fire a registration event, to tell the world that it could get a new reference for this component now

Just doing the first of these steps make the reference hold by any other component on the removed one useless, and with no way to know it have been disposed. So the component would need to check on every call to it that it has not been disposed, and properly refuse to serve if it has. And the rest world should be prepare for that, which seems to me not good design compare to the listening of the registration events.