try
{
comments = commentRepository.getAllComments(postId , loggedInUserId);
replies = replyRepository.getAllReplies(postId , loggedInUserId);
}catch(Exception e) {
comments = List.of();
replies = List.of();
}
List<CommentReplyDto> commentReplies = comments.stream()
.map(c ->
new CommentReplyDto
(c , replies.stream().
filter(r -> r.commentId().equals(c.commentId()))
.toList())).toList();
i am getting error local variable replies defined in an enclosing scope must be final or effectively final , why though ?