}
protected TransitionResultSet removeModule(ModuleStateHolder moduleStateHolder, Application application,
ModificationExtractor calculator, String moduleToRemove) {
RootModuleDefinition oldRootDefinition = moduleStateHolder.getRootModuleDefinition();
if (oldRootDefinition == null) {
return new TransitionResultSet();
}
RootModuleDefinition newRootDefinition = moduleStateHolder.cloneRootModuleDefinition();
ModuleDefinition definitionToRemove = newRootDefinition.findChildDefinition(moduleToRemove, true);
if (definitionToRemove != null) {
if (definitionToRemove instanceof RootModuleDefinition) {
//we're removing the rootModuleDefinition
TransitionSet transitions = calculator.getTransitions(application, oldRootDefinition, null);