Skip to content

Commit

Permalink
517028: ResourceException below CollectMissingNaturesVisitor.visit
Browse files Browse the repository at this point in the history
(thrown in Project.checkAccessible)

Check project accessibility before descending into it

Bug: 517028
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=517028
  • Loading branch information
creckord committed May 23, 2017
1 parent d55d913 commit a251c50
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ final class CollectMissingNaturesVisitor implements IResourceDeltaVisitor {
private final Set<String> missingNatures = new HashSet<String>();

public boolean visit(IResourceDelta delta) throws CoreException {
if (delta.getResource().getType() == IResource.PROJECT
|| delta.getResource().getType() == IResource.ROOT) {
if (delta.getResource().getType() == IResource.ROOT || (delta.getResource().getType() == IResource.PROJECT
&& ((IProject) delta.getResource()).isAccessible())) {
return true;
}
if (delta.getResource().getType() == IResource.FILE
Expand All @@ -34,6 +34,9 @@ public boolean visit(IResourceDelta delta) throws CoreException {
if (delta.getKind() == IResourceDelta.ADDED
|| delta.getKind() == IResourceDelta.CHANGED) {
IProject project = delta.getResource().getProject();
if (!project.isAccessible()) {
return false;
}
for (String natureId : project.getDescription().getNatureIds()) {
if (project.getWorkspace().getNatureDescriptor(natureId) == null) {
this.missingNatures.add(natureId);
Expand Down

0 comments on commit a251c50

Please sign in to comment.