void (@NotNull Collection<? extends ExportableOrderEntry> toRemove, @NotNull Module module, @NotNull IdeModifiableModelsProvider modelsProvider) { // do not remove 'invalid' module dependencies on unloaded modules List<? extends ExportableOrderEntry> filteredList = ContainerUtil.filter(toRemove, o -> { if (o instanceof ModuleOrderEntry) { String moduleName = ((ModuleOrderEntry)o).getModuleName(); return ModuleManager.getInstance(module.getProject()).getUnloadedModuleDescription(moduleName) == null; } return true; }); super.removeData(filteredList, module, modelsProvider); }