EA-19701 - assert: LibraryImpl.getUrls

This commit is contained in:
Sergey Evdokimov
2013-07-26 14:06:43 +04:00
parent 3f5abec9e0
commit 95ebcdb846
@@ -25,6 +25,7 @@ import com.intellij.openapi.roots.LibraryOrderEntry;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.ModuleRootModel;
import com.intellij.openapi.roots.OrderEntry;
import com.intellij.openapi.roots.impl.libraries.LibraryImpl;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.Pair;
@@ -559,7 +560,7 @@ public class MavenProjectImporter {
boolean removed = false;
for (Library each : unusedLibraries) {
if (MavenRootModelAdapter.isMavenLibrary(each) && !MavenRootModelAdapter.isChangedByUser(each)) {
if (!isDisposed(each) && MavenRootModelAdapter.isMavenLibrary(each) && !MavenRootModelAdapter.isChangedByUser(each)) {
myModelsProvider.removeLibrary(each);
removed = true;
}
@@ -567,6 +568,10 @@ public class MavenProjectImporter {
return removed;
}
private static boolean isDisposed(Library library) {
return library instanceof LibraryImpl && ((LibraryImpl)library).isDisposed();
}
private Collection<ModuleRootModel> collectModuleModels() {
Map<Module, ModuleRootModel> rootModels = new THashMap<Module, ModuleRootModel>();
for (MavenProject each : myProjectsToImportWithChanges.keySet()) {