mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for PR 64090
This commit is contained in:
parent
eea5bdc2c8
commit
b2b0ddb9b9
2 changed files with 32 additions and 16 deletions
|
@ -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
|
2004-06-07 Alain Magloire
|
||||||
|
|
||||||
Fix for PR 65633
|
Fix for PR 65633
|
||||||
|
|
|
@ -60,6 +60,7 @@ import org.eclipse.core.runtime.Path;
|
||||||
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.Job;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author alain
|
* @author alain
|
||||||
|
@ -126,9 +127,8 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPathEntry[] getResolvedPathEntries(ICProject cproject) throws CModelException {
|
public IPathEntry[] getResolvedPathEntries(ICProject cproject) throws CModelException {
|
||||||
//boolean markers = cproject.getProject().getWorkspace().isTreeLocked();
|
boolean markers = cproject.getProject().getWorkspace().isTreeLocked();
|
||||||
//return getResolvedPathEntries(cproject, !markers);
|
return getResolvedPathEntries(cproject, !markers);
|
||||||
return getResolvedPathEntries(cproject, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPathEntry[] getResolvedPathEntries(ICProject cproject, boolean generateMarkers) throws CModelException {
|
public IPathEntry[] getResolvedPathEntries(ICProject cproject, boolean generateMarkers) throws CModelException {
|
||||||
|
@ -163,18 +163,29 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
entries = new IPathEntry[list.size()];
|
entries = new IPathEntry[list.size()];
|
||||||
list.toArray(entries);
|
list.toArray(entries);
|
||||||
if (generateMarkers) {
|
if (generateMarkers) {
|
||||||
IProject project = cproject.getProject();
|
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);
|
flushPathEntryProblemMarkers(project);
|
||||||
ICModelStatus status = validatePathEntry(cproject, entries);
|
ICModelStatus status = validatePathEntry(finalCProject, finalEntries);
|
||||||
if (!status.isOK()) {
|
if (!status.isOK()) {
|
||||||
createPathEntryProblemMarker(project, status);
|
createPathEntryProblemMarker(project, status);
|
||||||
}
|
}
|
||||||
for (int j = 0; j < entries.length; j++) {
|
for (int j = 0; j < finalEntries.length; j++) {
|
||||||
status = validatePathEntry(cproject, entries[j], true, false);
|
status = validatePathEntry(finalCProject, finalEntries[j], true, false);
|
||||||
if (!status.isOK()) {
|
if (!status.isOK()) {
|
||||||
createPathEntryProblemMarker(project, status);
|
createPathEntryProblemMarker(project, status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return CModelStatus.OK_STATUS;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
markerTask.schedule();
|
||||||
}
|
}
|
||||||
resolvedMap.put(cproject, entries);
|
resolvedMap.put(cproject, entries);
|
||||||
}
|
}
|
||||||
|
@ -1264,7 +1275,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
);
|
);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
// could not create marker: cannot do much
|
// could not create marker: cannot do much
|
||||||
e.printStackTrace();
|
//e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1283,7 +1294,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
// could not flush markers: not much we can do
|
// could not flush markers: not much we can do
|
||||||
e.printStackTrace();
|
//e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue