PsiReference[] (@Nullable XmlAttributeValue element, PairFunction<? super String, ? super Integer, ? extends PsiReference> refFun) { if (element == null) { return PsiReference.EMPTY_ARRAY; } String text = element.getText(); String urls = StringUtil.unquoteString(text); StringTokenizer tokenizer = new StringTokenizer(urls); List<PsiReference> result = new ArrayList<>(); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); int index = text.indexOf(token); PsiReference ref = refFun.fun(token, index); if (ref != null) { result.add(ref); } } return result.toArray(PsiReference.EMPTY_ARRAY); }