From a251c508143cea76bee00b77bf76391275239895 Mon Sep 17 00:00:00 2001 From: Carsten Reckord Date: Tue, 23 May 2017 10:46:39 +0200 Subject: [PATCH] 517028: ResourceException below CollectMissingNaturesVisitor.visit (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 --- .../mpc/ui/discovery/CollectMissingNaturesVisitor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/discovery/CollectMissingNaturesVisitor.java b/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/discovery/CollectMissingNaturesVisitor.java index 79a9ef8e..83c097b2 100644 --- a/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/discovery/CollectMissingNaturesVisitor.java +++ b/org.eclipse.epp.mpc.ui/src/org/eclipse/epp/internal/mpc/ui/discovery/CollectMissingNaturesVisitor.java @@ -24,8 +24,8 @@ final class CollectMissingNaturesVisitor implements IResourceDeltaVisitor { private final Set missingNatures = new HashSet(); 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 @@ -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);