PsiAnnotation (String contractValue) { Map<String, PsiAnnotation> cache = CachedValuesManager.getManager(myProject).getCachedValue(myProject, () -> { Map<String, PsiAnnotation> map = ConcurrentFactoryMap.createMap(attrs -> createAnnotationFromText("@org.jetbrains.annotations.Contract(" + attrs + ")")); return CachedValueProvider.Result.create(map, ModificationTracker.NEVER_CHANGED); }); return cache.get(contractValue); }