Fixed regression in injector provider

This commit is contained in:
Sebastian Zarnekow 2019-04-04 21:46:11 +02:00
parent 4f5de9b818
commit 9f1b16b6a4
21 changed files with 22 additions and 45 deletions

View file

@ -67,8 +67,7 @@ public class IndentationAwareUiTestLanguageInjectorProvider implements IInjector
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -67,8 +67,7 @@ public class PartialContentAssistTestLanguageInjectorProvider implements IInject
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -67,8 +67,7 @@ public class PartialSerializationTestLanguageInjectorProvider implements IInject
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -67,8 +67,7 @@ public class RenameTestLanguageInjectorProvider implements IInjectorProvider, IR
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -67,8 +67,7 @@ public class TestLanguageInjectorProvider implements IInjectorProvider, IRegistr
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class FileAwareTestLanguageInjectorProvider implements IInjectorProvider,
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class XtextGrammarTestLanguageInjectorProvider implements IInjectorProvid
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class FormatterTestLanguageInjectorProvider implements IInjectorProvider,
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class RegionAccessTestLanguageInjectorProvider implements IInjectorProvid
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class LazyLinkingTestLanguageInjectorProvider implements IInjectorProvide
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class FragmentTestLanguageExInjectorProvider implements IInjectorProvider
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class FragmentTestLanguageInjectorProvider implements IInjectorProvider,
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class IndentationAwareTestLanguageInjectorProvider implements IInjectorPr
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class NoParametersTestLanguageInjectorProvider implements IInjectorProvid
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class ParametersTestLanguageExInjectorProvider implements IInjectorProvid
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class ParametersTestLanguageInjectorProvider implements IInjectorProvider
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class TwoParametersTestLanguageInjectorProvider implements IInjectorProvi
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -63,8 +63,7 @@ public class SequencerTestLanguageInjectorProvider implements IInjectorProvider,
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -41,8 +41,7 @@ public class XtextInjectorProvider implements IInjectorProvider, IRegistryConfig
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}

View file

@ -210,9 +210,8 @@ class JUnitFragment extends AbstractStubGeneratingFragment {
stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState();
if (injector == null) {
getInjector();
} else {
stateAfterInjectorCreation.restoreGlobalState();
}
stateAfterInjectorCreation.restoreGlobalState();
}
}
'''

View file

@ -513,13 +513,10 @@ public class JUnitFragment extends AbstractStubGeneratingFragment {
_builder.append("getInjector();");
_builder.newLine();
_builder.append("\t\t");
_builder.append("} else {");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("stateAfterInjectorCreation.restoreGlobalState();");
_builder.append("}");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.append("stateAfterInjectorCreation.restoreGlobalState();");
_builder.newLine();
_builder.append("\t");
_builder.append("}");