@NotNull private List<AnnotationData> collectExternalAnnotations(@NotNull PsiModifierListOwner listOwner) { if (!hasAnyAnnotationsRoots()) return Collections.emptyList(); List<AnnotationData> cached; while (true) { cached = (List<AnnotationData>) cache.get(listOwner); if (cached == NO_DATA || !cached.isEmpty()) return cached; List<AnnotationData> computed = doCollect(listOwner, false); if (cache.replace(listOwner, cached, computed)) { cached = computed; break; } } return cached; }
protected void dropCache() { myExternalAnnotations.clear(); annotationFileToDataAndModStamp.clear(); cache.clear(); }