}
ISchedulingRule rule = p.getWorkspace().getRuleFactory().refreshRule(p);
try {
getJobManager().beginRule(rule, monitor);
if(p.exists()) // handle missing projects after branch switch
p.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 1));
} catch (CoreException e) {
handleError(UIText.Activator_refreshFailed, e, false);
return new Status(IStatus.ERROR, getPluginId(), e.getMessage());
} finally {
getJobManager().endRule(rule);