Program: 62698
Project: 62698
Buggy source:
/** 
 * 管理员回复评论
 * @param commentId 被回复的评论
 * @param commentContent 回复的内容
 * @return string
 */
@PostMapping("String_Node_Str") public String replyComment(@RequestParam("String_Node_Str") Long commentId,@RequestParam("String_Node_Str") Long postId,@RequestParam("String_Node_Str") String commentContent,@RequestParam("String_Node_Str") String userAgent,HttpServletRequest request){
  try {
    Post post=new Post();
    post.setPostId(postId);
    Comment comment=new Comment();
    comment.setPost(post);
    comment.setCommentAuthor(userService.findAllUser().get(0).getUserDisplayName());
    comment.setCommentAuthorEmail(userService.findAllUser().get(0).getUserEmail());
    comment.setCommentAuthorUrl(HaloConst.OPTIONS.get("String_Node_Str"));
    comment.setCommentAuthorIp(HaloUtil.getIpAddr(request));
    comment.setCommentAuthorAvatarMd5(HaloUtil.getMD5(userService.findAllUser().get(0).getUserEmail()));
    comment.setCommentDate(new Date());
    String at="String_Node_Str" + commentService.findCommentById(commentId).get().getCommentAuthor() + "String_Node_Str";
    comment.setCommentContent(at + commentContent);
    comment.setCommentAgent(userAgent);
    comment.setCommentParent(commentId);
    comment.setCommentStatus(0);
    commentService.saveByComment(comment);
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e.getMessage());
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * 管理员回复评论
 * @param commentId 被回复的评论
 * @param commentContent 回复的内容
 * @return string
 */
@PostMapping("String_Node_Str") public String replyComment(@RequestParam("String_Node_Str") Long commentId,@RequestParam("String_Node_Str") Long postId,@RequestParam("String_Node_Str") String commentContent,@RequestParam("String_Node_Str") String userAgent,HttpServletRequest request,HttpSession session){
  try {
    Post post=new Post();
    post.setPostId(postId);
    User user=(User)session.getAttribute(HaloConst.USER_SESSION_KEY);
    Comment lastComment=commentService.findCommentById(commentId).get();
    Comment comment=new Comment();
    comment.setPost(post);
    comment.setCommentAuthor(user.getUserDisplayName());
    comment.setCommentAuthorEmail(user.getUserEmail());
    comment.setCommentAuthorUrl(HaloConst.OPTIONS.get("String_Node_Str"));
    comment.setCommentAuthorIp(HaloUtil.getIpAddr(request));
    comment.setCommentAuthorAvatarMd5(HaloUtil.getMD5(userService.findAllUser().get(0).getUserEmail()));
    comment.setCommentDate(new Date());
    String lastContent="String_Node_Str" + lastComment.getCommentAuthor() + "String_Node_Str"+ lastComment.getCommentContent();
    comment.setCommentContent(commentContent + lastContent);
    comment.setCommentAgent(userAgent);
    comment.setCommentParent(commentId);
    comment.setCommentStatus(0);
    commentService.saveByComment(comment);
    Pattern patternEmail=Pattern.compile("String_Node_Str");
    Matcher matcher=patternEmail.matcher(lastComment.getCommentAuthorEmail());
    if ("String_Node_Str".equals(HaloConst.OPTIONS.get("String_Node_Str")) && "String_Node_Str".equals(HaloConst.OPTIONS.get("String_Node_Str"))) {
      if (matcher.find()) {
        Map<String,Object> map=new HashMap<>();
        map.put("String_Node_Str",HaloConst.OPTIONS.get("String_Node_Str"));
        map.put("String_Node_Str",lastComment.getCommentAuthor());
        map.put("String_Node_Str",lastComment.getPost().getPostTitle());
        map.put("String_Node_Str",lastComment.getCommentContent());
        map.put("String_Node_Str",user.getUserDisplayName());
        map.put("String_Node_Str",commentContent);
        map.put("String_Node_Str",HaloConst.OPTIONS.get("String_Node_Str"));
        mailService.sendTemplateMail(lastComment.getCommentAuthorEmail(),"String_Node_Str" + HaloConst.OPTIONS.get("String_Node_Str") + "String_Node_Str",map,"String_Node_Str");
      }
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e.getMessage());
  }
  return "String_Node_Str";
}