Result (final String toplevelClassSrcFQName, final Map<String, File> children, final String packageVMName) { final Ref<VirtualFile> containingFileRef = new Ref<>(); final Ref<PsiClass> psiClassRef = new Ref<>(); if (myProject.isDisposed()) return null; final Boolean isInSource = DumbService.getInstance(myProject).runReadActionInSmartMode(() -> { if (myProject.isDisposed()) return null; final PsiClass aClass = JavaPsiFacade.getInstance(myProject).findClass(toplevelClassSrcFQName, mySuite.getSearchScope(myProject)); if (aClass == null || !aClass.isValid()) return Boolean.FALSE; psiClassRef.set(aClass); PsiElement element = aClass.getNavigationElement(); containingFileRef.set(PsiUtilCore.getVirtualFile(element)); if (containingFileRef.isNull()) { LOG.info("No virtual file found for: " + aClass); return null; } return mySuite.getCoverageEngine().acceptedByFilters(element.getContainingFile(), mySuite); }); if (isInSource == null || !isInSource.booleanValue()) return null; VirtualFile virtualFile = containingFileRef.get(); var topLevelClassCoverageInfo = new PackageAnnotator.ClassCoverageInfo(); VirtualFile parent = virtualFile == null ? null : virtualFile.getParent(); for (Map.Entry<String, File> e : children.entrySet()) { File file = e.getValue(); if (virtualFile == null && !ContainerUtil.exists(JavaCoverageEngineExtension.EP_NAME.getExtensions(), extension -> extension.keepCoverageInfoForClassWithoutSource(mySuite, file))) { continue; } String simpleName = e.getKey(); String classFqName = AnalysisUtils.internalNameToFqn(AnalysisUtils.buildVMName(packageVMName, simpleName)); var info = collectClassCoverageInformation(file, psiClassRef.get(), classFqName); if (info == null) continue; topLevelClassCoverageInfo.append(info); } return new Result(topLevelClassCoverageInfo, parent); }