IDEA-132645 Eclipse integration problem: all imported modules have been lost after project reloading (100% reproduce)

This commit is contained in:
Vladimir Krivosheev
2014-11-11 11:37:36 +01:00
parent d974c16880
commit 3885a8dc27
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,15 +40,20 @@ public class ModuleRootManagerComponent extends ModuleRootManagerImpl implements
super(module, projectRootManager, filePointerManager);
}
public static class StorageChooser implements StateStorageChooser<ModuleRootManagerImpl> {
static class StorageChooser implements StateStorageChooser<ModuleRootManagerImpl> {
@Override
public Storage[] selectStorages(Storage[] storages, ModuleRootManagerImpl moduleRootManager, final StateStorageOperation operation) {
final boolean isDefaultStorageType = ClassPathStorageUtil.isDefaultStorage(moduleRootManager.getModule());
final String id = isDefaultStorageType ? ClassPathStorageUtil.DEFAULT_STORAGE: ClasspathStorage.SPECIAL_STORAGE;
for (Storage storage : storages) {
if (storage.id().equals(id)) return new Storage[]{storage};
if (ClassPathStorageUtil.isDefaultStorage(moduleRootManager.getModule())) {
for (Storage storage : storages) {
if (storage.id().equals(ClassPathStorageUtil.DEFAULT_STORAGE)) {
return new Storage[]{storage};
}
}
throw new IllegalArgumentException();
}
else {
return storages;
}
throw new IllegalArgumentException();
}
}
}