1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 23:35:48 +02:00

Fix for the bug#132001. The resource change handling now always initiated with the job

This commit is contained in:
Mikhail Sennikovsky 2006-04-19 14:32:18 +00:00
parent c9c3a60a1d
commit f69a491f4d

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2003, 2005 IBM Corporation and others. * Copyright (c) 2003, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -27,14 +27,8 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
// NOTE: The code below is for tracking resource renaming and deleting. This is needed to keep
// ResourceConfiguration elements up to date. It may also be needed by AdditionalInput
// elements
//import org.eclipse.cdt.managedbuilder.internal.core.ResourceChangeHandler;
//import org.eclipse.core.resources.*;
public class ManagedBuilderCorePlugin extends Plugin { public class ManagedBuilderCorePlugin extends Plugin {
@ -88,9 +82,9 @@ public class ManagedBuilderCorePlugin extends Plugin {
// ResourceConfiguration elements up to date. It may also be needed by AdditionalInput // ResourceConfiguration elements up to date. It may also be needed by AdditionalInput
// elements // elements
IJobManager jobManager = Platform.getJobManager(); // IJobManager jobManager = Platform.getJobManager();
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
try { /* try {
jobManager.beginRule(root, null); jobManager.beginRule(root, null);
startResourceChangeHandling(); startResourceChangeHandling();
@ -99,7 +93,10 @@ public class ManagedBuilderCorePlugin extends Plugin {
//or core exception is thrown by the startResourceChangeHandling() //or core exception is thrown by the startResourceChangeHandling()
//in any case, schedule a job with the root rule //in any case, schedule a job with the root rule
//that will perform the resource change handling initialization //that will perform the resource change handling initialization
*/
//The startResourceChangeHandling() might result in throwing an error
//see bug# 132001
//Always schedule a job
Job rcJob = new Job(ManagedMakeMessages.getResourceString("ManagedBuilderCorePlugin.resourceChangeHandlingInitializationJob")){ //$NON-NLS-1$ Job rcJob = new Job(ManagedMakeMessages.getResourceString("ManagedBuilderCorePlugin.resourceChangeHandlingInitializationJob")){ //$NON-NLS-1$
protected IStatus run(IProgressMonitor monitor) { protected IStatus run(IProgressMonitor monitor) {
try{ try{
@ -121,10 +118,11 @@ public class ManagedBuilderCorePlugin extends Plugin {
rcJob.setPriority(Job.INTERACTIVE); rcJob.setPriority(Job.INTERACTIVE);
rcJob.setSystem(true); rcJob.setSystem(true);
rcJob.schedule(); rcJob.schedule();
/*
} finally { } finally {
jobManager.endRule(root); jobManager.endRule(root);
} }
*/
} }
/* /*