diagnostics and a possible fix for EA-99045 - assert: ResolveScopeManagerImpl.getDefaultResolveScope

This commit is contained in:
peter
2017-03-15 13:30:41 +01:00
parent 84b742bb57
commit dcd3c28229
2 changed files with 5 additions and 4 deletions
@@ -165,7 +165,7 @@ public class JavaFunctionalExpressionSearcher extends QueryExecutorBase<PsiFunct
if (allCandidates.isEmpty()) return;
for (VirtualFile vFile : putLikelyFilesFirst(descriptors, allCandidates.keySet(), project)) {
List<FunExprOccurrence> toLoad = filterInapplicable(samClasses, vFile, allCandidates.get(vFile));
List<FunExprOccurrence> toLoad = filterInapplicable(samClasses, vFile, allCandidates.get(vFile), project);
if (!toLoad.isEmpty()) {
LOG.trace("To load " + vFile.getPath() + " with values: " + toLoad);
if (!processor.process(vFile, ContainerUtil.map(toLoad, it -> it.funExprOffset))) {
@@ -186,8 +186,9 @@ public class JavaFunctionalExpressionSearcher extends QueryExecutorBase<PsiFunct
@NotNull
private static List<FunExprOccurrence> filterInapplicable(List<PsiClass> samClasses,
VirtualFile vFile,
Collection<FunExprOccurrence> occurrences) {
return ReadAction.compute(() -> ContainerUtil.filter(occurrences, it -> it.canHaveType(samClasses, vFile)));
Collection<FunExprOccurrence> occurrences, Project project) {
return ReadAction.compute(() -> project.isDisposed() ? Collections.emptyList()
: ContainerUtil.filter(occurrences, it -> it.canHaveType(samClasses, vFile)));
}
private static boolean processFile(@NotNull Processor<PsiFunctionalExpression> consumer,
@@ -153,7 +153,7 @@ public class ResolveScopeManagerImpl extends ResolveScopeManager {
@Override
public GlobalSearchScope getDefaultResolveScope(final VirtualFile vFile) {
final PsiFile psiFile = myManager.findFile(vFile);
assert psiFile != null;
assert psiFile != null : "directory=" + vFile.isDirectory() + "; " + myProject;
return getResolveScopeFromProviders(vFile);
}