void (@NotNull PsiReferenceExpression expression) { final JavaResolveResult resolveResult = expression.advancedResolve(true); final boolean staticImported = resolveResult.getCurrentFileResolveScope() instanceof PsiImportStaticStatement; final PsiElement qualifier = expression.getQualifier(); if (qualifier == null || qualifier instanceof PsiThisExpression) { final PsiElement referent = resolveResult.getElement(); if (referent instanceof PsiField field) { if (fieldIsExtracted(field)) { final String name = field.getName(); if (enumConstantFields.contains(field)) { out.append(name).append(".").append(getterName()).append("()"); } else { if (qualifier != null && name.equals(expression.getReferenceName())) { out.append("this."); } out.append(name); } } else { if (field.hasModifierProperty(PsiModifier.STATIC)) { if (field instanceof PsiEnumConstant) { out.append(field.getName()); } else if (staticImported) { final PsiImportStaticStatement importStaticStatement = (PsiImportStaticStatement)resolveResult.getCurrentFileResolveScope(); final PsiClass targetClass = importStaticStatement.resolveTargetClass(); out.append(targetClass != null ? targetClass.getQualifiedName() : "").append(".").append(field.getName()); } else { out.append(originalClassName).append('.').append(field.getName()); } } else { out.append(backPointerName).append('.').append(GenerateMembersUtil.suggestGetterName(field)).append("()"); } } } else if (referent instanceof PsiClass) { String qualifiedName = ((PsiClass)referent).getQualifiedName(); if (qualifiedName != null) { out.append(qualifiedName); } } else { visitElement(expression); } } else { visitElement(expression); } }