void (@NotNull PsiJavaCodeReferenceElement reference) { if (reference.isQualified() && reference.isReferenceTo(aClass)) { final PsiElement qualifier = reference.getQualifier(); if (qualifier instanceof PsiJavaCodeReferenceElement && ((PsiJavaCodeReferenceElement)qualifier).isReferenceTo(aPackage)) { try { ((PsiJavaCodeReferenceElement)qualifier).bindToElement(newContainingPackage); } catch (IncorrectOperationException e) { LOG.error(e); } } } super.visitReferenceElement(reference); }