Collection<PsiFileSystemItem> () { final FileReference contextRef = getContextReference(); List<PsiFileSystemItem> result = new ArrayList<>(); if (contextRef == null) { Collection<PsiFileSystemItem> defaultContexts = myFileReferenceSet.getDefaultContexts(); for (PsiFileSystemItem context : defaultContexts) { if (context == null) { LOG.error(PluginException.createByClass("Null context", null, myFileReferenceSet.getClass())); } } result.addAll(defaultContexts); } else { ResolveResult[] resolveResults = contextRef.multiResolve(false); for (ResolveResult resolveResult : resolveResults) { PsiElement element = resolveResult.getElement(); if (element != null) { result.add((PsiFileSystemItem)element); } } } result.addAll(myFileReferenceSet.getExtraContexts()); return result; }