void (@NotNull PsiJavaCodeReferenceElement reference) { final PsiElement qualifierExpression = reference.getQualifier(); if (qualifierExpression != null) { final Boolean preserveQualifier = qualifierExpression.getCopyableUserData(PRESERVE_QUALIFIER); if (preserveQualifier != null && !preserveQualifier) { PsiElement target = reference.resolve(); if (target != null) { PsiJavaCodeReferenceElement copy = (PsiJavaCodeReferenceElement)reference.copy(); Objects.requireNonNull(copy.getQualifier()).delete(); if (copy.resolve() == target) { qualifierExpression.delete(); return; } } } } super.visitReferenceElement(reference); }