break;
case IResource.PROJECT :
// NB: No need to check project's nature as if the project is not a java project:
// - if the project is added or changed this is a noop for projectsBeingDeleted
// - if the project is closed, it has already lost its java nature
IProject project = (IProject)resource;
JavaProject javaProject = (JavaProject)JavaCore.create(project);
switch (delta.getKind()) {
case IResourceDelta.ADDED :
this.manager.batchContainerInitializations = true;
// remember project and its dependents
addToRootsToRefreshWithDependents(javaProject);
// workaround for bug 15168 circular errors not reported
if (JavaProject.hasJavaNature(project)) {
addToParentInfo(javaProject);
readRawClasspath(javaProject);
// ensure project references are updated (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=121569)
checkProjectReferenceChange(project, javaProject);
}
this.state.rootsAreStale = true;
break;
case IResourceDelta.CHANGED :
if ((delta.getFlags() & IResourceDelta.OPEN) != 0) {
this.manager.batchContainerInitializations = true;
// project opened or closed: remember project and its dependents
addToRootsToRefreshWithDependents(javaProject);
// workaround for bug 15168 circular errors not reported
if (project.isOpen()) {
if (JavaProject.hasJavaNature(project)) {
addToParentInfo(javaProject);
readRawClasspath(javaProject);
// ensure project references are updated
checkProjectReferenceChange(project, javaProject);
}
} else {
try {
javaProject.close();
} catch (JavaModelException e) {
// java project doesn't exist: ignore
}
this.removeFromParentInfo(javaProject);
this.manager.removePerProjectInfo(javaProject);
this.manager.containerRemove(javaProject);
}
this.state.rootsAreStale = true;
} else if ((delta.getFlags() & IResourceDelta.DESCRIPTION) != 0) {
boolean wasJavaProject = this.state.findJavaProject(project.getName()) != null;
boolean isJavaProject = JavaProject.hasJavaNature(project);
if (wasJavaProject != isJavaProject) {
this.manager.batchContainerInitializations = true;
// java nature added or removed: remember project and its dependents