mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
bug 415286: Autobuild of a C++ project enters an infinite loop
This commit is contained in:
parent
73e87bf305
commit
ed74138b16
2 changed files with 36 additions and 1 deletions
|
@ -22,6 +22,8 @@ import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
|
|||
import org.eclipse.cdt.internal.core.XmlUtil;
|
||||
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsProvidersSerializer;
|
||||
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsSerializableStorage;
|
||||
import org.eclipse.cdt.internal.core.settings.model.CConfigurationSpecSettings;
|
||||
import org.eclipse.cdt.internal.core.settings.model.IInternalCCfgInfo;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
@ -273,12 +275,33 @@ public class LanguageSettingsSerializableProvider extends LanguageSettingsBasePr
|
|||
*/
|
||||
public void serializeLanguageSettingsInBackground(ICConfigurationDescription cfgDescription) {
|
||||
if (cfgDescription != null) {
|
||||
LanguageSettingsManager.serializeLanguageSettingsInBackground(cfgDescription.getProjectDescription());
|
||||
if (isLanguageSettingsProviderStoreChanged(cfgDescription)) {
|
||||
LanguageSettingsManager.serializeLanguageSettingsInBackground(cfgDescription.getProjectDescription());
|
||||
}
|
||||
} else {
|
||||
LanguageSettingsManager.serializeLanguageSettingsWorkspaceInBackground();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare provider store with cached persistent store used to calculate delta.
|
||||
*/
|
||||
private boolean isLanguageSettingsProviderStoreChanged(ICConfigurationDescription cfgDescription) {
|
||||
if (cfgDescription instanceof IInternalCCfgInfo) {
|
||||
try {
|
||||
CConfigurationSpecSettings ss = ((IInternalCCfgInfo)cfgDescription).getSpecSettings();
|
||||
if (ss != null) {
|
||||
return ss.isLanguageSettingsProviderStoreChanged(this);
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
// If something went wrong assuming it might have changed
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load provider from XML provider element.
|
||||
* This is convenience method not intended to be overridden on purpose.
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsBroadca
|
|||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
|
||||
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
|
||||
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
|
||||
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsSerializableProvider;
|
||||
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsStorage;
|
||||
import org.eclipse.cdt.core.settings.model.CExternalSetting;
|
||||
import org.eclipse.cdt.core.settings.model.ICBuildSetting;
|
||||
|
@ -1090,4 +1091,15 @@ public class CConfigurationSpecSettings implements ICSettingsStorage, ILanguageS
|
|||
return languageSettingsDelta;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if language settings that provider keeps got changed since last notification event.
|
||||
*
|
||||
* @param provider - serializable language settings provider.
|
||||
* @return {@code true} if provider's entries changed or {@code false} if not.
|
||||
*/
|
||||
public boolean isLanguageSettingsProviderStoreChanged(LanguageSettingsSerializableProvider provider) {
|
||||
LanguageSettingsStorage store = ((ILanguageSettingsBroadcastingProvider) provider).copyStorage();
|
||||
return ! store.equals(lspPersistedState.get(provider.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue