mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00
Apply proper restore logic also to SmokeTest infra
This commit is contained in:
parent
c4413b82cc
commit
97f3d9e9e0
1 changed files with 4 additions and 1 deletions
|
@ -38,7 +38,7 @@ public class WrappingInjectorProvider implements IInjectorProvider, IRegistryCon
|
|||
|
||||
private final IInjectorProvider delegate;
|
||||
private final Injector injector;
|
||||
private final GlobalStateMemento stateBeforeInjectorCreation;
|
||||
private GlobalStateMemento stateBeforeInjectorCreation;
|
||||
private final GlobalStateMemento stateAfterInjectorCreation;
|
||||
|
||||
public WrappingInjectorProvider(IInjectorProvider delegate) {
|
||||
|
@ -53,6 +53,7 @@ public class WrappingInjectorProvider implements IInjectorProvider, IRegistryCon
|
|||
if (delegate instanceof IRegistryConfigurator) {
|
||||
((IRegistryConfigurator) delegate).restoreRegistry();
|
||||
}
|
||||
stateBeforeInjectorCreation.restoreGlobalState();
|
||||
}
|
||||
|
||||
private void registerFactory(Injector injector) {
|
||||
|
@ -94,10 +95,12 @@ public class WrappingInjectorProvider implements IInjectorProvider, IRegistryCon
|
|||
@Override
|
||||
public void restoreRegistry() {
|
||||
stateBeforeInjectorCreation.restoreGlobalState();
|
||||
stateBeforeInjectorCreation = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupRegistry() {
|
||||
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
|
||||
stateAfterInjectorCreation.restoreGlobalState();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue