if (JavaModelManager.getJavaModelManager().isClasspathBeingResolved(this)) {
if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
verbose_reentering_classpath_resolution();
return RESOLUTION_IN_PROGRESS;
}
PerProjectInfo perProjectInfo = getPerProjectInfo();
// use synchronized block to ensure consistency
IClasspathEntry[] resolvedClasspath;
IJavaModelStatus unresolvedEntryStatus;
synchronized (perProjectInfo) {
resolvedClasspath = perProjectInfo.getResolvedClasspath();
unresolvedEntryStatus = perProjectInfo.unresolvedEntryStatus;
}
if (resolvedClasspath == null
|| (unresolvedEntryStatus != null && !unresolvedEntryStatus.isOK())) { // force resolution to ensure initializers are run again
resolveClasspath(perProjectInfo, false/*don't use previous session values*/, true/*add classpath change*/);
synchronized (perProjectInfo) {
resolvedClasspath = perProjectInfo.getResolvedClasspath();
unresolvedEntryStatus = perProjectInfo.unresolvedEntryStatus;
}
if (resolvedClasspath == null) {
// another thread reset the resolved classpath, use a temporary PerProjectInfo
PerProjectInfo temporaryInfo = newTemporaryInfo();
resolveClasspath(temporaryInfo, false/*don't use previous session values*/, true/*add classpath change*/);
resolvedClasspath = temporaryInfo.getResolvedClasspath();
unresolvedEntryStatus = temporaryInfo.unresolvedEntryStatus;
}
}
if (!ignoreUnresolvedEntry && unresolvedEntryStatus != null && !unresolvedEntryStatus.isOK())
throw new JavaModelException(unresolvedEntryStatus);