1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fixed outer scope rule bug

This commit is contained in:
Andrew Gvozdev 2011-12-16 14:21:20 -05:00
parent 115f78f7aa
commit 090af63d32

View file

@ -52,6 +52,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
@ -841,13 +842,15 @@ public class LanguageSettingsProvidersSerializer {
public static void loadLanguageSettings(ICProjectDescription prjDescription) {
IProject project = prjDescription.getProject();
IFile storeInPrjArea = project.getFile(SETTINGS_FOLDER_NAME + STORAGE_PROJECT_LANGUAGE_SETTINGS);
// AG: FIXME investigate this one
// Causes java.lang.IllegalArgumentException: Attempted to beginRule: P/cdt312, does not match outer scope rule: org.eclipse.cdt.internal.ui.text.c.hover.CSourceHover$SingletonRule@6f34fb
try {
storeInPrjArea.refreshLocal(IResource.DEPTH_ZERO, null);
} catch (CoreException e) {
Job currentJob = Job.getJobManager().currentJob();
ISchedulingRule currentRule = (currentJob != null) ? currentJob.getRule() : null;
if (currentRule == null || currentRule.contains(storeInPrjArea)) {
storeInPrjArea.refreshLocal(IResource.DEPTH_ZERO, null);
}
} catch (Throwable e) {
// ignore failure
CCorePlugin.log(e);
CCorePlugin.log("Internal Error trying to call IResourse.refreshLocal()", e); //$NON-NLS-1$
}
if (storeInPrjArea.exists()) {
Document doc = null;