Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
[#608] make sure that WrappingInjectorProvider records changes to the…
Browse files Browse the repository at this point in the history
… global registry even if the delegate itself is a IRegistryConfigurator and its injector is already created so that createInjector does not do anything that could be recorded

Signed-off-by: Christian Dietrich <[email protected]>
  • Loading branch information
cdietrich committed Jan 15, 2018
1 parent 4519cb8 commit 4f10ab7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ public WrappingInjectorProvider(IInjectorProvider delegate) {
this.delegate = delegate;
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
this.injector = createInjector();
if (delegate instanceof IRegistryConfigurator) {
((IRegistryConfigurator) delegate).setupRegistry();
}
registerFactory(injector);
stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (delegate instanceof IRegistryConfigurator) {
((IRegistryConfigurator) delegate).restoreRegistry();
}
}

private void registerFactory(Injector injector) {
Expand Down

0 comments on commit 4f10ab7

Please sign in to comment.