mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-132645 Eclipse integration problem: all imported modules have been lost after project reloading (100% reproduce)
This commit is contained in:
+12
-7
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user