diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog index 300a39b85de..dff7a979b6a 100644 --- a/core/org.eclipse.cdt.core/ChangeLog +++ b/core/org.eclipse.cdt.core/ChangeLog @@ -1,3 +1,8 @@ +2004-06-07 Alain Magloire + + Fix for PR 64090 + model/org/eclipse/cdt/internal/core/model/PathEntryManager.java + 2004-06-07 Alain Magloire Fix for PR 65633 diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java index f32e3746972..d83fea1f93f 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java @@ -60,6 +60,7 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; /** * @author alain @@ -126,9 +127,8 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange } public IPathEntry[] getResolvedPathEntries(ICProject cproject) throws CModelException { - //boolean markers = cproject.getProject().getWorkspace().isTreeLocked(); - //return getResolvedPathEntries(cproject, !markers); - return getResolvedPathEntries(cproject, false); + boolean markers = cproject.getProject().getWorkspace().isTreeLocked(); + return getResolvedPathEntries(cproject, !markers); } public IPathEntry[] getResolvedPathEntries(ICProject cproject, boolean generateMarkers) throws CModelException { @@ -163,18 +163,29 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange entries = new IPathEntry[list.size()]; list.toArray(entries); if (generateMarkers) { - IProject project = cproject.getProject(); - flushPathEntryProblemMarkers(project); - ICModelStatus status = validatePathEntry(cproject, entries); - if (!status.isOK()) { - createPathEntryProblemMarker(project, status); - } - for (int j = 0; j < entries.length; j++) { - status = validatePathEntry(cproject, entries[j], true, false); - if (!status.isOK()) { - createPathEntryProblemMarker(project, status); + final ICProject finalCProject = cproject; + final IPathEntry[] finalEntries = entries; + Job markerTask = new Job("PathEntry Marker Job") { //$NON-NLS-1$ + /* (non-Javadoc) + * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) + */ + protected IStatus run(IProgressMonitor monitor) { + IProject project = finalCProject.getProject(); + flushPathEntryProblemMarkers(project); + ICModelStatus status = validatePathEntry(finalCProject, finalEntries); + if (!status.isOK()) { + createPathEntryProblemMarker(project, status); + } + for (int j = 0; j < finalEntries.length; j++) { + status = validatePathEntry(finalCProject, finalEntries[j], true, false); + if (!status.isOK()) { + createPathEntryProblemMarker(project, status); + } + } + return CModelStatus.OK_STATUS; } - } + }; + markerTask.schedule(); } resolvedMap.put(cproject, entries); } @@ -1264,7 +1275,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange ); } catch (CoreException e) { // could not create marker: cannot do much - e.printStackTrace(); + //e.printStackTrace(); } } @@ -1283,7 +1294,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange } } catch (CoreException e) { // could not flush markers: not much we can do - e.printStackTrace(); + //e.printStackTrace(); } }