void (@NotNull Project project, @NotNull ModuleProblemDescriptor descriptor) { final ModifiableRootModel model = ModuleRootManager.getInstance(descriptor.getModule()).getModifiableModel(); for (OrderEntry entry : model.getOrderEntries()) { if (entry instanceof ModuleOrderEntry) { final String mDependency = ((ModuleOrderEntry)entry).getModuleName(); if (Objects.equals(mDependency, myDependency)) { model.removeOrderEntry(entry); break; } } } model.commit(); }