String (@Nullable PsiExpression value, @NotNull CommentTracker commentTracker) { if (value == null) { return ""; } if (!(value instanceof PsiReferenceExpression referenceExpression)) { return commentTracker.text(value); } final PsiElement target = referenceExpression.resolve(); if (!(target instanceof PsiEnumConstant enumConstant)) { return commentTracker.text(value); } final PsiClass aClass = enumConstant.getContainingClass(); if (aClass == null) { return commentTracker.text(value); } String qualifiedName = ObjectUtils.notNull(aClass.getQualifiedName(), Objects.requireNonNull(aClass.getName())); return qualifiedName + '.' + commentTracker.text(referenceExpression); }