diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java index 2938c2a6539..d44c3dc7ae5 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/CoreModel.java @@ -67,10 +67,10 @@ import org.eclipse.core.runtime.jobs.ISchedulingRule; * @noinstantiate This class is not intended to be instantiated by clients. */ public class CoreModel { - private static CoreModel cmodel = null; - private static CModelManager manager = CModelManager.getDefault(); - private static PathEntryManager pathEntryManager = PathEntryManager.getDefault(); - private static CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance(); + private static CoreModel cmodel; + private static final CModelManager manager = CModelManager.getDefault(); + private static final PathEntryManager pathEntryManager = PathEntryManager.getDefault(); + private static final CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance(); public final static String CORE_MODEL_ID = CCorePlugin.PLUGIN_ID + ".coremodel"; //$NON-NLS-1$ @@ -1461,7 +1461,11 @@ public class CoreModel { descriptionManager.removeCProjectDescriptionListener(listener); } - public ICProjectDescriptionManager getProjectDescriptionManager(){ - return descriptionManager; + public ICProjectDescriptionManager getProjectDescriptionManager() { + if (descriptionManager != null) + return descriptionManager; + + // Initialization of the CoreModel hasn't finished yet. + return CProjectDescriptionManager.getInstance(); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java index 57b7dc04297..f8597bfb5fb 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java @@ -267,7 +267,6 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { synchronized (CProjectDescriptionManager.class) { if (fInstance == null) { fInstance = new CProjectDescriptionManager(); - fInstance.initProviderInfo(); } } } @@ -342,6 +341,8 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager { Job rcJob = new Job(SettingsModelMessages.getString("CProjectDescriptionManager.0")) { //$NON-NLS-1$ @Override protected IStatus run(IProgressMonitor monitor) { + fInstance.initProviderInfo(); + try { startSaveParticipant(); } catch (CoreException e) {