CachedValue<PsiReference[]> (final PsiElement element, Object p) { return CachedValuesManager.getManager(element.getProject()).createCachedValue(() -> { IssueNavigationConfiguration navigationConfiguration = IssueNavigationConfiguration.getInstance(element.getProject()); if (navigationConfiguration == null) { return CachedValueProvider.Result.create(PsiReference.EMPTY_ARRAY, element); } List<PsiReference> refs = null; GlobalPathReferenceProvider provider = myReferenceProvider.get(); CharSequence commentText = StringUtil.newBombedCharSequence(element.getText(), 500); for (IssueNavigationConfiguration.LinkMatch link : navigationConfiguration.findIssueLinks(commentText)) { if (refs == null) refs = new SmartList<>(); if (provider == null) { provider = (GlobalPathReferenceProvider)PathReferenceManager.getInstance().getGlobalWebPathReferenceProvider(); myReferenceProvider.lazySet(provider); } provider.createUrlReference(element, link.getTargetUrl(), link.getRange(), refs); } PsiReference[] references = refs != null ? refs.toArray(PsiReference.EMPTY_ARRAY) : PsiReference.EMPTY_ARRAY; return new CachedValueProvider.Result<>(references, element, navigationConfiguration); }, false); }