mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
AppCode:Project: conflicting component names prevented XcodeMetaData save its state (OC-4617)
This commit is contained in:
@@ -30,7 +30,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@State(name = "XcodeMetaData", storages = {@Storage(file = StoragePathMacros.WORKSPACE_FILE, scheme = StorageScheme.DEFAULT)})
|
||||
@State(name = "ExecutionTargetManager", storages = {@Storage(file = StoragePathMacros.WORKSPACE_FILE, scheme = StorageScheme.DEFAULT)})
|
||||
public class ExecutionTargetManagerImpl extends ExecutionTargetManager implements ProjectComponent, PersistentStateComponent<Element> {
|
||||
@NotNull private final Project myProject;
|
||||
@NotNull private final Object myActiveTargetLock = new Object();
|
||||
|
||||
+10
-2
@@ -160,7 +160,7 @@ abstract class ComponentStoreImpl implements IComponentStore {
|
||||
private String initJdomExternalizable(@NotNull JDOMExternalizable component) {
|
||||
final String componentName = ComponentManagerImpl.getComponentName(component);
|
||||
|
||||
myComponents.put(componentName, component);
|
||||
doAddComponent(componentName, component);
|
||||
|
||||
if (optimizeTestLoading()) return componentName;
|
||||
|
||||
@@ -188,6 +188,14 @@ abstract class ComponentStoreImpl implements IComponentStore {
|
||||
return componentName;
|
||||
}
|
||||
|
||||
private void doAddComponent(String componentName, Object component) {
|
||||
if (myComponents.containsKey(componentName)) {
|
||||
LOG.error("Conflicting component name '" + componentName + "': "
|
||||
+ myComponents.get(componentName).getClass() + " and " + component.getClass());
|
||||
}
|
||||
myComponents.put(componentName, component);
|
||||
}
|
||||
|
||||
private void loadJdomDefaults(@NotNull final Object component, final String componentName) {
|
||||
try {
|
||||
StateStorage defaultsStorage = getDefaultsStorage();
|
||||
@@ -250,7 +258,7 @@ abstract class ComponentStoreImpl implements IComponentStore {
|
||||
roamingManager.setRoamingType(name, roamingTypeFromComponent);
|
||||
}
|
||||
|
||||
myComponents.put(name, component);
|
||||
doAddComponent(name, component);
|
||||
if (optimizeTestLoading()) return name;
|
||||
|
||||
Class<T> stateClass = getComponentStateClass(component);
|
||||
|
||||
Reference in New Issue
Block a user