void (@NotNull PsiImportStaticReferenceElement ref) { String refName = ref.getReferenceName(); JavaResolveResult[] results = ref.multiResolve(false); PsiElement referenceNameElement = ref.getReferenceNameElement(); if (results.length == 0) { String description = JavaErrorBundle.message("cannot.resolve.symbol", refName); assert referenceNameElement != null : ref; HighlightInfo.Builder info = HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF).range(referenceNameElement).descriptionAndTooltip(description); add(info); } else { PsiManager manager = ref.getManager(); for (JavaResolveResult result : results) { PsiElement element = result.getElement(); String description = null; if (element instanceof PsiClass) { Pair<PsiImportStaticReferenceElement, PsiClass> imported = mySingleImportedClasses.get(refName); PsiClass aClass = Pair.getSecond(imported); if (aClass != null && !manager.areElementsEquivalent(aClass, element)) { description = imported.first == null ? JavaErrorBundle.message("single.import.class.conflict", refName) : imported.first.equals(ref) ? JavaErrorBundle.message("class.is.ambiguous.in.single.static.import", refName) : JavaErrorBundle.message("class.is.already.defined.in.single.static.import", refName); } mySingleImportedClasses.put(refName, Pair.create(ref, (PsiClass)element)); } else if (element instanceof PsiField) { Pair<PsiImportStaticReferenceElement, PsiField> imported = mySingleImportedFields.get(refName); PsiField field = Pair.getSecond(imported); if (field != null && !manager.areElementsEquivalent(field, element)) { description = imported.first.equals(ref) ? JavaErrorBundle.message("field.is.ambiguous.in.single.static.import", refName) : JavaErrorBundle.message("field.is.already.defined.in.single.static.import", refName); } mySingleImportedFields.put(refName, Pair.create(ref, (PsiField)element)); } if (description != null) { add(HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(ref).descriptionAndTooltip(description)); } } } if (!hasErrorResults() && results.length == 1) { add(HighlightUtil.checkReference(ref, results[0], myFile, myLanguageLevel)); if (!hasErrorResults()) { PsiElement element = results[0].getElement(); PsiClass containingClass = element instanceof PsiMethod ? ((PsiMethod)element).getContainingClass() : null; if (containingClass != null && containingClass.isInterface()) { add( HighlightMethodUtil.checkStaticInterfaceCallQualifier(ref, results[0], ObjectUtils.notNull(ref.getReferenceNameElement(), ref), containingClass)); } } } }