void () { boolean jdkProcessed = false; for (OrderEntry e : myRootModel.getOrderEntries()) { if (e instanceof ModuleSourceOrderEntry || e instanceof JdkOrderEntry) { jdkProcessed = true; continue; } if (e instanceof LibraryOrderEntry) { if (Registry.is("maven.always.remove.bad.entries")) { if (!isMavenLibrary((LibraryOrderEntry)e)) { MavenImportCollector.HAS_USER_ADDED_LIBRARY_DEP.log(myRootModel.getProject()); continue; } } else { if (!isMavenLibrary(((LibraryOrderEntry)e).getLibrary())) { MavenImportCollector.HAS_USER_ADDED_LIBRARY_DEP.log(myRootModel.getProject()); continue; } } } if (e instanceof ModuleOrderEntry) { Module m = ((ModuleOrderEntry)e).getModule(); if (m != null && !MavenProjectsManager.getInstance(myRootModel.getProject()).isMavenizedModule(m) && ExternalSystemModulePropertyManager.getInstance(m).getExternalSystemId() == null) { MavenImportCollector.HAS_USER_ADDED_MODULE_DEP.log(myRootModel.getProject()); continue; } } if (!jdkProcessed) { if (e instanceof ModuleOrderEntry) { myOrderEntriesBeforeJdk.add(((ModuleOrderEntry)e).getModuleName()); } else if (e instanceof LibraryOrderEntry) { myOrderEntriesBeforeJdk.add(((LibraryOrderEntry)e).getLibraryName()); } } myRootModel.removeOrderEntry(e); } }