nus-yam/ex-repair huggingface dataset:
Program: 175661
Project: 175661
Buggy source:
@Override @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  String userid=req.getParameter("String_Node_Str");
  String password=req.getParameter("String_Node_Str");
  HttpSession session=req.getSession(true);
  if (authUser(userid,password)) {
    session.setAttribute("String_Node_Str","String_Node_Str");
    session.setAttribute("String_Node_Str",userid);
    String target=(String)session.getAttribute("String_Node_Str");
    if (target == null) {
      res.sendRedirect("String_Node_Str");
    }
 else {
      session.removeAttribute("String_Node_Str");
      res.sendRedirect(target);
    }
  }
 else {
    session.setAttribute("String_Node_Str","String_Node_Str");
    return doGet(mav,req,res,locale);
  }
  return null;
}

Fixed version (ground truth):
@Override @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  String userid=req.getParameter("String_Node_Str");
  String password=req.getParameter("String_Node_Str");
  HttpSession session=req.getSession(true);
  if (authUser(userid,password)) {
    session.setAttribute("String_Node_Str","String_Node_Str");
    session.setAttribute("String_Node_Str",userid);
    String target=(String)session.getAttribute("String_Node_Str");
    if (target == null) {
      res.sendRedirect("String_Node_Str");
    }
 else {
      session.removeAttribute("String_Node_Str");
      res.sendRedirect(target);
    }
  }
 else {
    session.setAttribute("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    return doGet(mav,req,res,locale);
  }
  return null;
}
Program: 175662
Project: 175662
Buggy source:
@Override @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  String userid=req.getParameter("String_Node_Str");
  String password=req.getParameter("String_Node_Str");
  String loginQueryString=req.getParameter("String_Node_Str");
  if (loginQueryString == null) {
    loginQueryString="String_Node_Str";
  }
 else {
    loginQueryString="String_Node_Str" + loginQueryString;
  }
  HttpSession session=req.getSession(true);
  if (isAccountLocked(userid)) {
    session.setAttribute("String_Node_Str","String_Node_Str");
    res.sendRedirect("String_Node_Str" + loginQueryString);
  }
 else   if (authUser(userid,password)) {
    resetAccountLock(userid);
    session.setAttribute("String_Node_Str","String_Node_Str");
    session.setAttribute("String_Node_Str",userid);
    String gotoUrl=req.getParameter("String_Node_Str");
    if (gotoUrl != null) {
      res.sendRedirect(gotoUrl);
    }
 else {
      String target=(String)session.getAttribute("String_Node_Str");
      if (target == null) {
        res.sendRedirect("String_Node_Str");
      }
 else {
        session.removeAttribute("String_Node_Str");
        res.sendRedirect(target);
      }
    }
  }
 else {
    incrementAccountLockNum(userid);
    session.setAttribute("String_Node_Str","String_Node_Str");
    res.sendRedirect("String_Node_Str" + loginQueryString);
  }
  return null;
}

Fixed version (ground truth):
@Override @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  String userid=req.getParameter("String_Node_Str");
  String password=req.getParameter("String_Node_Str");
  String loginQueryString=req.getParameter("String_Node_Str");
  if (loginQueryString == null) {
    loginQueryString="String_Node_Str";
  }
 else {
    loginQueryString="String_Node_Str" + loginQueryString;
  }
  HttpSession session=req.getSession(true);
  if (isAccountLocked(userid)) {
    incrementLoginFailedCount(userid);
    session.setAttribute("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    res.sendRedirect("String_Node_Str" + loginQueryString);
  }
 else   if (authUser(userid,password)) {
    resetAccountLock(userid);
    session.setAttribute("String_Node_Str","String_Node_Str");
    session.setAttribute("String_Node_Str",userid);
    String gotoUrl=req.getParameter("String_Node_Str");
    if (gotoUrl != null) {
      res.sendRedirect(gotoUrl);
    }
 else {
      String target=(String)session.getAttribute("String_Node_Str");
      if (target == null) {
        res.sendRedirect("String_Node_Str");
      }
 else {
        session.removeAttribute("String_Node_Str");
        res.sendRedirect(target);
      }
    }
  }
 else {
    incrementLoginFailedCount(userid);
    session.setAttribute("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    res.sendRedirect("String_Node_Str" + loginQueryString);
  }
  return null;
}
Program: 175663
Project: 175663
Buggy source:
@Override @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  String userid=req.getParameter("String_Node_Str");
  String password=req.getParameter("String_Node_Str");
  HttpSession session=req.getSession(true);
  if (isAccountLocked(userid)) {
    session.setAttribute("String_Node_Str","String_Node_Str");
    return doGet(mav,req,res,locale);
  }
 else   if (!isExistUser(userid)) {
    session.setAttribute("String_Node_Str","String_Node_Str");
    return doGet(mav,req,res,locale);
  }
 else   if (!password.matches("String_Node_Str")) {
    session.setAttribute("String_Node_Str","String_Node_Str");
    return doGet(mav,req,res,locale);
  }
 else   if (authUser(userid,password)) {
    resetAccountLock(userid);
    session.setAttribute("String_Node_Str","String_Node_Str");
    session.setAttribute("String_Node_Str",userid);
    String target=(String)session.getAttribute("String_Node_Str");
    if (target == null) {
      res.sendRedirect("String_Node_Str");
    }
 else {
      session.removeAttribute("String_Node_Str");
      res.sendRedirect(target);
    }
  }
 else {
    incrementAccountLockNum(userid);
    session.setAttribute("String_Node_Str","String_Node_Str");
    return doGet(mav,req,res,locale);
  }
  return null;
}

Fixed version (ground truth):
@Override @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  String userid=req.getParameter("String_Node_Str");
  String password=req.getParameter("String_Node_Str");
  HttpSession session=req.getSession(true);
  if (isAccountLocked(userid)) {
    session.setAttribute("String_Node_Str",msg.getMessage("String_Node_Str",new String[]{String.valueOf(accountLockCount)},locale));
  }
 else   if (!isExistUser(userid)) {
    session.setAttribute("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
 else   if (!password.matches("String_Node_Str")) {
    session.setAttribute("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
 else   if (authUser(userid,password)) {
    resetAccountLock(userid);
    session.setAttribute("String_Node_Str","String_Node_Str");
    session.setAttribute("String_Node_Str",userid);
    String target=(String)session.getAttribute("String_Node_Str");
    if (target == null) {
      res.sendRedirect("String_Node_Str");
      return null;
    }
 else {
      session.removeAttribute("String_Node_Str");
      res.sendRedirect(target);
      return null;
    }
  }
 else {
    session.setAttribute("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
  incrementLoginFailedCount(userid);
  return doGet(mav,req,res,locale);
}
Program: 175664
Project: 175664
Buggy source:
private boolean isExistUser(String username){
  try {
    LdapQuery query=LdapQueryBuilder.query().where("String_Node_Str").is(username);
    User user=ldapTemplate.findOne(query,User.class);
    if (user != null) {
      return true;
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
private boolean isExistUser(String username){
  try {
    LdapQuery query=LdapQueryBuilder.query().where("String_Node_Str").is(username);
    User user=ldapTemplate.findOne(query,User.class);
    if (user != null) {
      return true;
    }
  }
 catch (  EmptyResultDataAccessException e) {
  }
catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
  return false;
}
Program: 175666
Project: 175666
Buggy source:
@RequestMapping(value="String_Node_Str") public void serverinfo(HttpSession ses,HttpServletResponse res,Locale locale) throws IOException {
  StringBuilder sb=new StringBuilder();
  Properties properties=System.getProperties();
  for (  Object key : properties.keySet()) {
    Object value=properties.get(key);
    sb.append("String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str");
  }
  Resource resource=new ClassPathResource("String_Node_Str");
  String htmlString=IOUtils.toString(resource.getInputStream());
  htmlString=htmlString.replace("String_Node_Str",(String)ses.getAttribute("String_Node_Str"));
  htmlString=htmlString.replace("String_Node_Str",sb.toString());
  htmlString=repacLocalizedString(htmlString,locale);
  res.getWriter().write(htmlString);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str") public void serverinfo(HttpSession ses,HttpServletResponse res,Locale locale) throws IOException {
  StringBuilder sb=new StringBuilder();
  Properties properties=System.getProperties();
  for (  Object key : properties.keySet()) {
    Object value=properties.get(key);
    sb.append("String_Node_Str" + key + "String_Node_Str"+ value+ "String_Node_Str");
  }
  Resource resource=new ClassPathResource("String_Node_Str");
  String htmlString=IOUtils.toString(resource.getInputStream());
  String userid=(String)ses.getAttribute("String_Node_Str");
  if (userid == null) {
    res.sendRedirect("String_Node_Str");
    return;
  }
  htmlString=htmlString.replace("String_Node_Str",userid);
  htmlString=htmlString.replace("String_Node_Str",sb.toString());
  htmlString=repacLocalizedString(htmlString,locale);
  res.getWriter().write(htmlString);
}
Program: 175667
Project: 175667
Buggy source:
@Transactional public void updateUsers(List<User> users,Locale locale,ModelAndView mav){
  DefaultTransactionDefinition dtDef=new DefaultTransactionDefinition();
  TransactionStatus trnStatus=txMgr.getTransaction(dtDef);
  int executeUpdate=0;
  try {
    for (    User user : users) {
      executeUpdate=executeUpdate + jdbcTemplate.update("String_Node_Str",user.getName(),user.getPhone(),user.getMail(),user.getUserId());
      log.info(user.getUserId() + "String_Node_Str");
      Thread.sleep(500);
    }
    txMgr.commit(trnStatus);
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",new Object[]{executeUpdate},null,locale));
  }
 catch (  DeadlockLoserDataAccessException e) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    log.error("String_Node_Str",e);
  }
catch (  DataAccessException e) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",new String[]{e.getMessage()},null,locale));
    log.error("String_Node_Str",e);
  }
catch (  Exception e) {
    txMgr.rollback(trnStatus);
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",new String[]{e.getMessage()},null,locale));
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void updateUsers(List<User> users,Locale locale,ModelAndView mav){
  DefaultTransactionDefinition dtDef=new DefaultTransactionDefinition();
  TransactionStatus trnStatus=txMgr.getTransaction(dtDef);
  int executeUpdate=0;
  try {
    for (    User user : users) {
      executeUpdate=executeUpdate + jdbcTemplate.update("String_Node_Str",user.getName(),user.getPhone(),user.getMail(),user.getUserId());
      log.info(user.getUserId() + "String_Node_Str");
      Thread.sleep(500);
    }
    txMgr.commit(trnStatus);
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",new Object[]{executeUpdate},null,locale));
  }
 catch (  DeadlockLoserDataAccessException e) {
    txMgr.rollback(trnStatus);
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    log.error("String_Node_Str",e);
  }
catch (  DataAccessException e) {
    txMgr.rollback(trnStatus);
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",new String[]{e.getMessage()},null,locale));
    log.error("String_Node_Str",e);
  }
catch (  Exception e) {
    txMgr.rollback(trnStatus);
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",new String[]{e.getMessage()},null,locale));
    log.error("String_Node_Str",e);
  }
}
Program: 175668
Project: 175668
Buggy source:
/** 
 * Call   {@link #doFilter(HttpServletRequest,HttpServletResponse,FilterChain)}.
 * @see Filter#doFilter(ServletRequest,ServletResponse,FilterChain)
 */
@Override public void doFilter(ServletRequest req,ServletResponse res,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)req;
  HttpServletResponse response=(HttpServletResponse)res;
  String target=request.getRequestURI();
  if (!target.startsWith("String_Node_Str")) {
    response.addHeader("String_Node_Str","String_Node_Str");
  }
  response.addHeader("String_Node_Str","String_Node_Str");
  if (!target.startsWith("String_Node_Str")) {
    response.addHeader("String_Node_Str","String_Node_Str");
  }
  chain.doFilter(req,res);
}

Fixed version (ground truth):
/** 
 * Call   {@link #doFilter(HttpServletRequest,HttpServletResponse,FilterChain)}.
 * @see Filter#doFilter(ServletRequest,ServletResponse,FilterChain)
 */
@Override public void doFilter(ServletRequest req,ServletResponse res,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)req;
  HttpServletResponse response=(HttpServletResponse)res;
  String target=request.getRequestURI();
  if (target.startsWith("String_Node_Str") && request.getMethod().equalsIgnoreCase("String_Node_Str")) {
    ServletFileUpload upload=new ServletFileUpload();
    upload.setFileItemFactory(new DiskFileItemFactory());
    upload.setFileSizeMax(1024 * 1024 * 10);
    upload.setSizeMax(1024 * 1024 * 50);
    try {
      upload.parseRequest(new ServletRequestContext(request));
    }
 catch (    FileUploadException e) {
      throw new ServletException(e);
    }
  }
  if (!target.startsWith("String_Node_Str")) {
    response.addHeader("String_Node_Str","String_Node_Str");
  }
  response.addHeader("String_Node_Str","String_Node_Str");
  if (!target.startsWith("String_Node_Str")) {
    response.addHeader("String_Node_Str","String_Node_Str");
  }
  chain.doFilter(req,res);
}
Program: 175669
Project: 175669
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  mav.setViewName("String_Node_Str");
  mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  String appPath=req.getServletContext().getRealPath("String_Node_Str");
  String savePath=appPath + File.separator + SAVE_DIR;
  File fileSaveDir=new File(savePath);
  if (!fileSaveDir.exists()) {
    fileSaveDir.mkdir();
  }
  Part filePart=null;
  try {
    filePart=req.getPart("String_Node_Str");
  }
 catch (  Exception e) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    return doGet(mav,req,res,locale);
  }
  String fileName=getFileName(filePart);
  if (StringUtils.isBlank(fileName)) {
    return doGet(mav,req,res,locale);
  }
  boolean isConverted=writeFile(savePath,filePart,fileName);
  if (!isConverted) {
    isConverted=convert2GrayScale(new File(savePath + File.separator + fileName).getAbsolutePath());
  }
  if (isConverted) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    mav.addObject("String_Node_Str",SAVE_DIR + "String_Node_Str" + fileName);
  }
 else {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
  return mav;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(@RequestParam("String_Node_Str") MultipartFile file,ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  mav.setViewName("String_Node_Str");
  mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  String appPath=req.getServletContext().getRealPath("String_Node_Str");
  String savePath=appPath + File.separator + SAVE_DIR;
  File fileSaveDir=new File(savePath);
  if (!fileSaveDir.exists()) {
    fileSaveDir.mkdir();
  }
  String fileName=file.getOriginalFilename();
  if (StringUtils.isBlank(fileName)) {
    return doGet(mav,req,res,locale);
  }
  boolean isConverted=writeFile(savePath,file,fileName);
  if (!isConverted) {
    isConverted=convert2GrayScale(new File(savePath + File.separator + fileName).getAbsolutePath());
  }
  if (isConverted) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    mav.addObject("String_Node_Str",SAVE_DIR + "String_Node_Str" + fileName);
  }
 else {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
  return mav;
}
Program: 175670
Project: 175670
Buggy source:
private boolean writeFile(String savePath,Part filePart,String fileName) throws IOException {
  boolean isConverted=false;
  try (OutputStream out=new FileOutputStream(savePath + File.separator + fileName);InputStream in=filePart.getInputStream()){
    int read=0;
    final byte[] bytes=new byte[1024];
    while ((read=in.read(bytes)) != -1) {
      out.write(bytes,0,read);
    }
  }
 catch (  FileNotFoundException e) {
    isConverted=true;
  }
  return isConverted;
}

Fixed version (ground truth):
private boolean writeFile(String savePath,MultipartFile filePart,String fileName) throws IOException {
  boolean isConverted=false;
  try (OutputStream out=new FileOutputStream(savePath + File.separator + fileName);InputStream in=filePart.getInputStream()){
    int read=0;
    final byte[] bytes=new byte[1024];
    while ((read=in.read(bytes)) != -1) {
      out.write(bytes,0,read);
    }
  }
 catch (  FileNotFoundException e) {
    isConverted=true;
  }
  return isConverted;
}
Program: 175671
Project: 175671
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  mav.setViewName("String_Node_Str");
  mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  String appPath=req.getServletContext().getRealPath("String_Node_Str");
  String savePath=appPath + File.separator + SAVE_DIR;
  File fileSaveDir=new File(savePath);
  if (!fileSaveDir.exists()) {
    fileSaveDir.mkdir();
  }
  Part filePart=null;
  try {
    filePart=req.getPart("String_Node_Str");
  }
 catch (  Exception e) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    return doGet(mav,req,res,locale);
  }
  String fileName=getFileName(filePart);
  if (StringUtils.isBlank(fileName)) {
    return doGet(mav,req,res,locale);
  }
 else   if (!isImageFile(fileName)) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    return doGet(mav,req,res,locale);
  }
  boolean isConverted=writeFile(savePath,filePart,fileName);
  if (!isConverted) {
    isConverted=reverseColor(new File(savePath + File.separator + fileName).getAbsolutePath());
  }
  if (isConverted) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    mav.addObject("String_Node_Str",SAVE_DIR + "String_Node_Str" + fileName);
  }
 else {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
  return mav;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView doPost(@RequestParam("String_Node_Str") MultipartFile file,ModelAndView mav,HttpServletRequest req,HttpServletResponse res,Locale locale) throws IOException {
  mav.setViewName("String_Node_Str");
  mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  String appPath=req.getServletContext().getRealPath("String_Node_Str");
  String savePath=appPath + File.separator + SAVE_DIR;
  File fileSaveDir=new File(savePath);
  if (!fileSaveDir.exists()) {
    fileSaveDir.mkdir();
  }
  String fileName=file.getOriginalFilename();
  if (StringUtils.isBlank(fileName)) {
    return doGet(mav,req,res,locale);
  }
 else   if (!isImageFile(fileName)) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    return doGet(mav,req,res,locale);
  }
  boolean isConverted=writeFile(savePath,file,fileName);
  if (!isConverted) {
    isConverted=reverseColor(new File(savePath + File.separator + fileName).getAbsolutePath());
  }
  if (isConverted) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    mav.addObject("String_Node_Str",SAVE_DIR + "String_Node_Str" + fileName);
  }
 else {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
  return mav;
}
Program: 175672
Project: 175672
Buggy source:
private boolean writeFile(String savePath,Part filePart,String fileName) throws IOException {
  boolean isConverted=false;
  try (OutputStream out=new FileOutputStream(savePath + File.separator + fileName);InputStream in=filePart.getInputStream()){
    int read=0;
    final byte[] bytes=new byte[1024];
    while ((read=in.read(bytes)) != -1) {
      out.write(bytes,0,read);
    }
  }
 catch (  FileNotFoundException e) {
    isConverted=true;
  }
  return isConverted;
}

Fixed version (ground truth):
private boolean writeFile(String savePath,MultipartFile filePart,String fileName) throws IOException {
  boolean isConverted=false;
  try (OutputStream out=new FileOutputStream(savePath + File.separator + fileName);InputStream in=filePart.getInputStream()){
    int read=0;
    final byte[] bytes=new byte[1024];
    while ((read=in.read(bytes)) != -1) {
      out.write(bytes,0,read);
    }
  }
 catch (  FileNotFoundException e) {
    isConverted=true;
  }
  return isConverted;
}
Program: 175673
Project: 175673
Buggy source:
@RequestMapping(value="String_Node_Str") public ModelAndView process(ModelAndView mav,Locale locale){
  mav.setViewName("String_Node_Str");
  mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  if (StringUtils.isBlank(datasourceUrl) || datasourceUrl.startsWith("String_Node_Str")) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    return mav;
  }
 else {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
  List<User> users=selectUsers(mav,locale);
  if (users.isEmpty()) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
 else {
    mav.addObject("String_Node_Str",users);
  }
  return mav;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str") public ModelAndView process(ModelAndView mav,Locale locale){
  mav.setViewName("String_Node_Str");
  mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  if (StringUtils.isBlank(datasourceUrl) || datasourceUrl.startsWith("String_Node_Str")) {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    return mav;
  }
 else {
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
  try {
    List<User> users=selectUsers(mav,locale);
    if (users.isEmpty()) {
      mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
    }
 else {
      mav.addObject("String_Node_Str",users);
    }
  }
 catch (  SQLException se) {
    log.error("String_Node_Str",se);
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
  return mav;
}
Program: 175674
Project: 175674
Buggy source:
private List<User> selectUsers(ModelAndView mav,Locale locale){
  List<User> users=new ArrayList<>();
  try {
    Connection conn=null;
    Statement stmt=null;
    ResultSet rs=null;
    conn=DriverManager.getConnection(datasourceUrl);
    stmt=conn.createStatement();
    rs=stmt.executeQuery("String_Node_Str");
    while (rs.next()) {
      User user=new User();
      user.setUserId(rs.getString("String_Node_Str"));
      user.setName(rs.getString("String_Node_Str"));
      user.setPhone(rs.getString("String_Node_Str"));
      user.setMail(rs.getString("String_Node_Str"));
      users.add(user);
    }
  }
 catch (  SQLException se) {
    log.error("String_Node_Str",se);
    mav.addObject("String_Node_Str",msg.getMessage("String_Node_Str",null,locale));
  }
  return users;
}

Fixed version (ground truth):
private List<User> selectUsers(ModelAndView mav,Locale locale) throws SQLException {
  List<User> users=new ArrayList<>();
  Connection conn=null;
  Statement stmt=null;
  ResultSet rs=null;
  conn=jdbcTemplate.getDataSource().getConnection();
  stmt=conn.createStatement();
  rs=stmt.executeQuery("String_Node_Str");
  while (rs.next()) {
    User user=new User();
    user.setUserId(rs.getString("String_Node_Str"));
    user.setName(rs.getString("String_Node_Str"));
    user.setPhone(rs.getString("String_Node_Str"));
    user.setMail(rs.getString("String_Node_Str"));
    users.add(user);
  }
  return users;
}
Program: 175675
Project: 175675
Buggy source:
/** 
 * Call   {@link #doFilter(HttpServletRequest,HttpServletResponse,FilterChain)}.
 * @see Filter#doFilter(ServletRequest,ServletResponse,FilterChain)
 */
@Override public void doFilter(ServletRequest req,ServletResponse res,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)req;
  HttpServletResponse response=(HttpServletResponse)res;
  String target=request.getRequestURI();
  if (!target.startsWith("String_Node_Str") && request.getMethod().equalsIgnoreCase("String_Node_Str")) {
    ServletFileUpload upload=new ServletFileUpload();
    upload.setFileItemFactory(new DiskFileItemFactory());
    upload.setFileSizeMax(1024 * 1024 * 10);
    upload.setSizeMax(1024 * 1024 * 50);
    try {
      upload.parseRequest(new ServletRequestContext(request));
    }
 catch (    FileUploadException e) {
      throw new ServletException(e);
    }
  }
  if (!target.startsWith("String_Node_Str")) {
    response.addHeader("String_Node_Str","String_Node_Str");
  }
  response.addHeader("String_Node_Str","String_Node_Str");
  if (!target.startsWith("String_Node_Str")) {
    response.addHeader("String_Node_Str","String_Node_Str");
  }
  chain.doFilter(req,res);
}

Fixed version (ground truth):
/** 
 * Call   {@link #doFilter(HttpServletRequest,HttpServletResponse,FilterChain)}.
 * @see Filter#doFilter(ServletRequest,ServletResponse,FilterChain)
 */
@Override public void doFilter(ServletRequest req,ServletResponse res,FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)req;
  HttpServletResponse response=(HttpServletResponse)res;
  String target=request.getRequestURI();
  if ((target.startsWith("String_Node_Str") || target.startsWith("String_Node_Str") || target.startsWith("String_Node_Str")) && request.getMethod().equalsIgnoreCase("String_Node_Str")) {
    ServletFileUpload upload=new ServletFileUpload();
    upload.setFileItemFactory(new DiskFileItemFactory());
    upload.setFileSizeMax(1024 * 1024 * 10);
    upload.setSizeMax(1024 * 1024 * 50);
    try {
      upload.parseRequest(new ServletRequestContext(request));
    }
 catch (    FileUploadException e) {
      throw new ServletException(e);
    }
  }
  if (!target.startsWith("String_Node_Str")) {
    response.addHeader("String_Node_Str","String_Node_Str");
  }
  response.addHeader("String_Node_Str","String_Node_Str");
  if (!target.startsWith("String_Node_Str")) {
    response.addHeader("String_Node_Str","String_Node_Str");
  }
  chain.doFilter(req,res);
}
Program: 175677
Project: 175677
Buggy source:
public AntiSpam(){
  timeRecord=Maps.newHashMap();
  AzurePlayerList.bind(this);
}

Fixed version (ground truth):
public AntiSpam(){
  timeRecord=Maps.newHashMap();
  AzurePlayerList.bind(this);
  Bukkit.getScheduler().runTaskTimer(VLagger.MainThis,new Runnable(){
    @Override public void run(){
      timeRecord.clear();
    }
  }
,(long)ConfigFunction.AntiSpamPeriodPeriod * 10000,(long)ConfigFunction.AntiSpamPeriodPeriod * 10000);
}
Program: 175678
Project: 175678
Buggy source:
@Override public void run(){
  CheckedTimes.clear();
}

Fixed version (ground truth):
@Override public void run(){
  block.setType(Material.AIR,true);
}
Program: 175679
Project: 175679
Buggy source:
@EventHandler public void CheckRedstone(BlockRedstoneEvent event){
  if (event.getOldCurrent() > event.getNewCurrent()) {
    return;
  }
  final Block block=event.getBlock();
  Location loc=block.getLocation();
  if (CheckedTimes.get(loc) == null) {
    CheckedTimes.put(loc,0);
  }
  CheckedTimes.put(loc,CheckedTimes.get(loc) + 1);
  if (CheckedTimes.get(loc) > ConfigOptimize.AntiRedstoneTimes) {
    if (AzureAPI.containsIgnoreCase(ConfigOptimize.AntiRedstoneRemoveBlockList,block.getType().name())) {
      block.setType(Material.AIR);
      String message=ConfigOptimize.AntiRedstoneMessage;
      message=StringUtils.replace(message,"String_Node_Str",loc.toString());
      AzureAPI.bc(message);
    }
  }
}

Fixed version (ground truth):
@EventHandler public void CheckRedstone(BlockRedstoneEvent event){
  if (event.getOldCurrent() > event.getNewCurrent()) {
    return;
  }
  final Block block=event.getBlock();
  Location loc=block.getLocation();
  if (CheckedTimes.get(loc) == null) {
    CheckedTimes.put(loc,0);
  }
  CheckedTimes.put(loc,CheckedTimes.get(loc) + 1);
  if (CheckedTimes.get(loc) > ConfigOptimize.AntiRedstoneTimes) {
    if (AzureAPI.containsIgnoreCase(ConfigOptimize.AntiRedstoneRemoveBlockList,block.getType().name())) {
      Bukkit.getScheduler().runTask(VLagger.MainThis,new Runnable(){
        @Override public void run(){
          block.setType(Material.AIR,true);
        }
      }
);
      String message=ConfigOptimize.AntiRedstoneMessage;
      message=StringUtils.replace(message,"String_Node_Str",loc.toString());
      AzureAPI.bc(message);
    }
  }
}
Program: 175680
Project: 175680
Buggy source:
private static boolean CheckFast(Chunk chunk){
  if (ChunkLastTime.containsKey(chunk)) {
    return (((Long)ChunkLastTime.get(chunk)).longValue() + 50L > System.currentTimeMillis());
  }
  return false;
}

Fixed version (ground truth):
private static boolean CheckFast(Chunk chunk){
  if (ChunkLastTime.containsKey(chunk)) {
    return (ChunkLastTime.get(chunk).longValue() + 50L > System.currentTimeMillis());
  }
  return false;
}
Program: 175681
Project: 175681
Buggy source:
public void run(){
  CheckedTimes.clear();
}

Fixed version (ground truth):
@Override public void run(){
  CheckedTimes.clear();
}
Program: 175682
Project: 175682
Buggy source:
public WaterFlowLimitor(){
  Bukkit.getScheduler().runTaskTimer(VLagger.MainThis,new Runnable(){
    public void run(){
      CheckedTimes.clear();
    }
  }
,7 * 20,7 * 20);
}

Fixed version (ground truth):
public WaterFlowLimitor(){
  Bukkit.getScheduler().runTaskTimer(VLagger.MainThis,new Runnable(){
    @Override public void run(){
      CheckedTimes.clear();
    }
  }
,7 * 20,7 * 20);
}
Program: 175683
Project: 175683
Buggy source:
@SuppressWarnings("String_Node_Str") @EventHandler public void ClickCheckItem(InventoryClickEvent event){
  if (ConfigPatch.AntiLongStringCrashenable == true) {
    if (event.getWhoClicked().getType() != EntityType.PLAYER) {
      return;
    }
    Player player=(Player)event.getWhoClicked();
    ItemStack item=event.getCursor();
    if (item != null) {
      if (item.hasItemMeta() && item.getItemMeta().getDisplayName() != null) {
        if (item.getItemMeta().getDisplayName().length() > 20) {
          player.setItemInHand(null);
          AzureAPI.log(player,ConfigPatch.AntiLongStringCrashWarnMessage);
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void ClickCheckItem(InventoryClickEvent evt){
  if (ConfigPatch.AntiLongStringCrashenable == true) {
    if (evt.getWhoClicked().getType() != EntityType.PLAYER) {
      return;
    }
    Player player=(Player)evt.getWhoClicked();
    ItemStack item=evt.getCursor();
    if (item != null) {
      if (item.hasItemMeta() && item.getItemMeta().getDisplayName() != null) {
        if (item.getItemMeta().getDisplayName().length() > 96) {
          evt.setCancelled(true);
          evt.setCurrentItem(null);
          AzureAPI.log(player,ConfigPatch.AntiLongStringCrashWarnMessage);
        }
      }
    }
  }
}
Program: 175684
Project: 175684
Buggy source:
@SuppressWarnings("String_Node_Str") @EventHandler public void InteractCheck(PlayerInteractEvent event){
  if (ConfigPatch.AntiLongStringCrashenable == true) {
    ItemStack item=event.getItem();
    Player player=event.getPlayer();
    if (item != null) {
      if (item.hasItemMeta() && item.getItemMeta().getDisplayName() != null) {
        if (item.getItemMeta().getDisplayName().length() > 20) {
          player.setItemInHand(null);
          AzureAPI.log(player,ConfigPatch.AntiLongStringCrashWarnMessage);
        }
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @EventHandler public void InteractCheck(PlayerInteractEvent evt){
  if (ConfigPatch.AntiLongStringCrashenable == true) {
    ItemStack item=evt.getItem();
    Player player=evt.getPlayer();
    if (item != null) {
      if (item.hasItemMeta() && item.getItemMeta().getDisplayName() != null) {
        if (item.getItemMeta().getDisplayName().length() > 96) {
          evt.setCancelled(true);
          player.setItemInHand(null);
          AzureAPI.log(player,ConfigPatch.AntiLongStringCrashWarnMessage);
        }
      }
    }
  }
}
Program: 175685
Project: 175685
Buggy source:
public static void fatal(final String prefix,final String context){
  Bukkit.getLogger().severe(prefix + context);
  Bukkit.shutdown();
}

Fixed version (ground truth):
public static void fatal(final String prefix,final String context){
  Bukkit.getLogger().severe(prefix + context);
  if (plugin == null) {
    Bukkit.shutdown();
  }
 else {
    Bukkit.getPluginManager().disablePlugin(plugin);
  }
}
Program: 175687
Project: 175687
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  centerX=getWidth() / 2;
  centerY=getHeight() / 2;
}

Fixed version (ground truth):
@Override @CallSuper protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  centerX=getPaddingLeft() + (getWidth() - getPaddingLeft() - getPaddingRight()) / 2;
  centerY=getPaddingTop() + (getHeight() - getPaddingTop() - getPaddingBottom()) / 2;
}
Program: 175688
Project: 175688
Buggy source:
@Override public void onAnimationUpdate(ValueAnimator animation){
  int value=(int)animation.getAnimatedValue();
  shadowRadius=value;
  invalidate();
}

Fixed version (ground truth):
@Override public void onAnimationUpdate(ValueAnimator animation){
  int value=(int)animation.getAnimatedValue();
  tempShadowRadius=value;
  invalidate();
}
Program: 175689
Project: 175689
Buggy source:
@Override protected final void onDraw(Canvas canvas){
  canvas.drawARGB(0,0,0,0);
  int sd;
  if (isCreate) {
    sd=1;
    isCreate=false;
  }
 else   sd=shadowRadius;
  paint.setMaskFilter(new BlurMaskFilter(sd,BlurMaskFilter.Blur.SOLID));
  drawOuter(canvas);
  drawInside(canvas);
}

Fixed version (ground truth):
@Override protected final void onDraw(Canvas canvas){
  canvas.drawARGB(0,0,0,0);
  paint.setMaskFilter(new BlurMaskFilter(tempShadowRadius,BlurMaskFilter.Blur.SOLID));
  drawOuter(canvas);
  drawInside(canvas);
}
Program: 175690
Project: 175690
Buggy source:
@Override protected void onDraw(Canvas canvas){
  canvas.drawARGB(0,0,0,0);
  int sd;
  if (isCreate) {
    sd=1;
    isCreate=false;
  }
 else   sd=shadowRadius;
  paint.setMaskFilter(new BlurMaskFilter(sd,BlurMaskFilter.Blur.SOLID));
  drawOuter(canvas);
  drawInside(canvas);
}

Fixed version (ground truth):
@Override protected final void onDraw(Canvas canvas){
  canvas.drawARGB(0,0,0,0);
  int sd;
  if (isCreate) {
    sd=1;
    isCreate=false;
  }
 else   sd=shadowRadius;
  paint.setMaskFilter(new BlurMaskFilter(sd,BlurMaskFilter.Blur.SOLID));
  drawOuter(canvas);
  drawInside(canvas);
}
Program: 175691
Project: 175691
Buggy source:
public SkipView(Context context,@Nullable AttributeSet attrs,int defStyleAttr){
  super(context,attrs,defStyleAttr);
  coordinate=new float[9][2];
  TypedArray array=context.getTheme().obtainStyledAttributes(attrs,R.styleable.SkipView,defStyleAttr,0);
  triangleRadius=array.getDimensionPixelSize(R.styleable.SkipView_triangleRadius,0);
  innerLineRadius=array.getDimensionPixelSize(R.styleable.SkipView_innerLineRadius,0);
  distance=array.getDimensionPixelSize(R.styleable.SkipView_distance,0);
  triangleColor=array.getColor(R.styleable.SkipView_triangleColor,defaultColor);
  innerLineWidth=array.getDimensionPixelSize(R.styleable.SkipView_innerLineWidth,2);
  triangleHollow=array.getBoolean(R.styleable.SkipView_triangleHollow,false);
  triangleStroke=array.getDimensionPixelSize(R.styleable.SkipView_triangleStroke,2);
  innerLineHeight=array.getDimensionPixelSize(R.styleable.SkipView_innerLineHeight,0);
  triangleHeight=array.getDimensionPixelSize(R.styleable.SkipView_triangleHeight,0);
  triangleWidth=array.getDimensionPixelSize(R.styleable.SkipView_triangleWidth,0);
  array.recycle();
}

Fixed version (ground truth):
public SkipView(Context context,@Nullable AttributeSet attrs,int defStyleAttr){
  super(context,attrs,defStyleAttr);
  coordinate=new float[9][2];
  TypedArray array=context.getTheme().obtainStyledAttributes(attrs,R.styleable.SkipView,defStyleAttr,0);
  triangleRadius=array.getDimensionPixelSize(R.styleable.SkipView_triangleRadius,0);
  innerLineRadius=array.getDimensionPixelSize(R.styleable.SkipView_innerLineRadius,0);
  distance=array.getDimensionPixelSize(R.styleable.SkipView_distance,0);
  triangleColor=array.getColor(R.styleable.SkipView_triangleColor,defaultColor);
  triangleHollow=array.getBoolean(R.styleable.SkipView_triangleHollow,false);
  triangleStroke=array.getDimensionPixelSize(R.styleable.SkipView_triangleStroke,2);
  innerLineWidth=array.getDimensionPixelSize(R.styleable.SkipView_innerLineWidth,2);
  innerLineHeight=array.getDimensionPixelSize(R.styleable.SkipView_innerLineHeight,radius * 2 / 3);
  triangleHeight=array.getDimensionPixelSize(R.styleable.SkipView_triangleHeight,0);
  triangleWidth=array.getDimensionPixelSize(R.styleable.SkipView_triangleWidth,0);
  array.recycle();
}
Program: 175693
Project: 175693
Buggy source:
/** 
 * 绘制单竖线
 */
protected void drawLine(Canvas canvas){
  paint.setStyle(Paint.Style.FILL);
  paint.setColor(triangleColor);
  float left=coordinate[0][0] - distance - innerLineWidth;
  float top=coordinate[0][1] - innerLineHeight / 2;
  float right=left + innerLineWidth;
  float bottom=top + innerLineHeight;
  RectF rectF=new RectF(left,top,right,bottom);
  canvas.drawRoundRect(rectF,innerLineRadius,innerLineRadius,paint);
}

Fixed version (ground truth):
/** 
 * 绘制单竖线
 */
protected void drawLine(Canvas canvas){
  if (innerLineHeight <= 0 || innerLineWidth <= 0)   return;
  paint.setStyle(Paint.Style.FILL);
  paint.setColor(triangleColor);
  float left=coordinate[0][0] - distance - innerLineWidth;
  float top=coordinate[0][1] - innerLineHeight / 2;
  float right=left + innerLineWidth;
  float bottom=top + innerLineHeight;
  RectF rectF=new RectF(left,top,right,bottom);
  canvas.drawRoundRect(rectF,innerLineRadius,innerLineRadius,paint);
}
Program: 175694
Project: 175694
Buggy source:
public BrokerMessage.MessageContent read(long offset){
  if (offset >= startOffset + fileSize) {
    LOG.warn("String_Node_Str",offset);
    return null;
  }
  try {
    channel.position(offset - startOffset);
    ByteBuffer headerBuffer=ByteBuffer.allocate(MESSAGE_HEADER_LENGTH);
    int readLen=channel.read(headerBuffer);
    if (readLen != MESSAGE_HEADER_LENGTH) {
      LOG.warn("String_Node_Str");
      return null;
    }
    headerBuffer.flip();
    long crc32=headerBuffer.getLong();
    int messageLen=headerBuffer.getInt();
    LOG.info("String_Node_Str",messageLen);
    ByteBuffer messageContentBuffer=ByteBuffer.allocate(messageLen);
    readLen=channel.read(messageContentBuffer);
    if (readLen != messageLen) {
      LOG.warn("String_Node_Str");
      return null;
    }
    if (BrokerUtils.getCRC32(messageContentBuffer.array()) != crc32) {
      LOG.warn("String_Node_Str");
      return null;
    }
    BrokerMessage.MessageContent message=BrokerMessage.MessageContent.parseFrom(messageContentBuffer.array());
    BrokerMessage.MessageContent result=BrokerMessage.MessageContent.newBuilder().mergeFrom(message).setSize(MESSAGE_HEADER_LENGTH + messageLen).build();
    return result;
  }
 catch (  IOException ex) {
    LOG.warn("String_Node_Str",dirName,fileName,offset);
    return null;
  }
}

Fixed version (ground truth):
public BrokerMessage.MessageContent read(long offset){
  if (offset >= startOffset + fileSize) {
    LOG.debug("String_Node_Str",offset);
    return null;
  }
  try {
    channel.position(offset - startOffset);
    ByteBuffer headerBuffer=ByteBuffer.allocate(MESSAGE_HEADER_LENGTH);
    int readLen=channel.read(headerBuffer);
    if (readLen != MESSAGE_HEADER_LENGTH) {
      LOG.warn("String_Node_Str");
      return null;
    }
    headerBuffer.flip();
    long crc32=headerBuffer.getLong();
    int messageLen=headerBuffer.getInt();
    LOG.info("String_Node_Str",messageLen);
    ByteBuffer messageContentBuffer=ByteBuffer.allocate(messageLen);
    readLen=channel.read(messageContentBuffer);
    if (readLen != messageLen) {
      LOG.warn("String_Node_Str");
      return null;
    }
    if (BrokerUtils.getCRC32(messageContentBuffer.array()) != crc32) {
      LOG.warn("String_Node_Str");
      return null;
    }
    BrokerMessage.MessageContent message=BrokerMessage.MessageContent.parseFrom(messageContentBuffer.array());
    BrokerMessage.MessageContent result=BrokerMessage.MessageContent.newBuilder().mergeFrom(message).setSize(MESSAGE_HEADER_LENGTH + messageLen).build();
    return result;
  }
 catch (  IOException ex) {
    LOG.warn("String_Node_Str",dirName,fileName,offset);
    return null;
  }
}
Program: 175697
Project: 175697
Buggy source:
public BrokerStateMachine(){
  String dataDir=GlobalConf.getInstance().getDataDir();
  this.messageDir=dataDir + File.separator + "String_Node_Str";
}

Fixed version (ground truth):
public BrokerStateMachine(String dataDir){
  this.messageDir=dataDir + File.separator + "String_Node_Str";
}
Program: 175698
Project: 175698
Buggy source:
@Override public void readSnapshot(String snapshotDir){
  try {
    isAvailable.compareAndSet(true,false);
    Path link=FileSystems.getDefault().getPath(snapshotDir);
    if (!Files.isSymbolicLink(link)) {
      if (logManager != null) {
        logManager.close();
      }
      File messageDirFile=new File(messageDir);
      if (messageDirFile.exists()) {
        FileUtils.deleteDirectory(messageDirFile);
      }
      File snapshotDirFile=new File(snapshotDir);
      if (snapshotDirFile.exists()) {
        FileUtils.copyDirectory(snapshotDirFile,messageDirFile);
      }
    }
    logManager=new LogManager(messageDir,this);
  }
 catch (  IOException ex) {
    LOG.error("String_Node_Str",ex);
    throw new RuntimeException(ex);
  }
 finally {
    isAvailable.compareAndSet(false,true);
  }
}

Fixed version (ground truth):
@Override public void readSnapshot(String snapshotDir){
  try {
    isAvailable.compareAndSet(true,false);
    Path link=FileSystems.getDefault().getPath(snapshotDir);
    if (!Files.isSymbolicLink(link)) {
      if (logManager != null) {
        logManager.close();
      }
      File snapshotDirFile=new File(snapshotDir);
      if (snapshotDirFile.exists() && snapshotDirFile.listFiles().length > 0) {
        File messageDirFile=new File(messageDir);
        if (messageDirFile.exists()) {
          FileUtils.deleteDirectory(messageDirFile);
        }
        FileUtils.copyDirectory(snapshotDirFile,messageDirFile);
      }
    }
    logManager=new LogManager(messageDir,this);
  }
 catch (  IOException ex) {
    LOG.error("String_Node_Str",ex);
    throw new RuntimeException(ex);
  }
 finally {
    isAvailable.compareAndSet(false,true);
  }
}
Program: 175700
Project: 175700
Buggy source:
public LogManager(String logDir,BrokerStateMachine stateMachine){
  this.stateMachine=stateMachine;
  this.topicLogMap=new ConcurrentHashMap<>();
  this.logDir=logDir;
  File dirFile=new File(logDir);
  if (!dirFile.exists()) {
    dirFile.mkdirs();
  }
  File[] topicDirs=dirFile.listFiles();
  if (topicDirs != null) {
    for (    File topicDir : topicDirs) {
      if (!topicDir.isDirectory()) {
        LOG.warn("String_Node_Str",topicDir.getAbsolutePath());
        continue;
      }
      LOG.info("String_Node_Str" + topicDir.getAbsolutePath());
      if (!this.topicLogMap.containsKey(topicDir)) {
        this.topicLogMap.put(topicDir.getName(),new ConcurrentHashMap<Integer,SegmentedLog>());
      }
      Map<Integer,SegmentedLog> queueMap=this.topicLogMap.get(topicDir.getName());
      File[] queueDirs=topicDir.listFiles();
      if (queueDirs != null) {
        for (        File queueDir : queueDirs) {
          if (!queueDir.isDirectory()) {
            LOG.warn("String_Node_Str",queueDir.getAbsolutePath());
            continue;
          }
          Integer queueId=Integer.valueOf(queueDir.getName());
          String fullQueuePath=logDir + File.separator + topicDir+ File.separator+ queueDir;
          SegmentedLog queueLog=new SegmentedLog(fullQueuePath);
          queueMap.put(queueId,queueLog);
        }
      }
    }
  }
  timer.scheduleWithFixedDelay(this,GlobalConf.getInstance().getExpiredLogCheckInterval(),GlobalConf.getInstance().getExpiredLogCheckInterval(),TimeUnit.SECONDS);
}

Fixed version (ground truth):
public LogManager(String logDir,BrokerStateMachine stateMachine) throws IOException {
  this.stateMachine=stateMachine;
  this.topicLogMap=new ConcurrentHashMap<>();
  this.logDir=logDir;
  File dirFile=new File(logDir);
  if (!dirFile.exists()) {
    dirFile.mkdirs();
  }
  File[] topicDirs=dirFile.listFiles();
  if (topicDirs != null) {
    for (    File topicDir : topicDirs) {
      if (!topicDir.isDirectory()) {
        LOG.warn("String_Node_Str",topicDir.getAbsolutePath());
        continue;
      }
      LOG.info("String_Node_Str" + topicDir.getAbsolutePath());
      if (!this.topicLogMap.containsKey(topicDir)) {
        this.topicLogMap.put(topicDir.getName(),new ConcurrentHashMap<Integer,SegmentedLog>());
      }
      Map<Integer,SegmentedLog> queueMap=this.topicLogMap.get(topicDir.getName());
      File[] queueDirs=topicDir.listFiles();
      if (queueDirs != null) {
        for (        File queueDir : queueDirs) {
          if (!queueDir.isDirectory()) {
            LOG.warn("String_Node_Str",queueDir.getAbsolutePath());
            continue;
          }
          Integer queueId=Integer.valueOf(queueDir.getName());
          String fullQueuePath=queueDir.getCanonicalPath();
          SegmentedLog queueLog=new SegmentedLog(fullQueuePath);
          queueMap.put(queueId,queueLog);
        }
      }
    }
  }
  timer.scheduleWithFixedDelay(this,GlobalConf.getInstance().getExpiredLogCheckInterval(),GlobalConf.getInstance().getExpiredLogCheckInterval(),TimeUnit.SECONDS);
}
Program: 175701
Project: 175701
Buggy source:
public void delete(){
  close();
  String fullFileName=dirName + File.separator + fileName;
  File file=new File(fullFileName);
  file.delete();
  try {
    FileUtils.forceDelete(file);
  }
 catch (  IOException ex) {
    LOG.warn("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public void delete(){
  close();
  String fullFileName=dirName + File.separator + fileName;
  File file=new File(fullFileName);
  try {
    FileUtils.forceDelete(file);
  }
 catch (  IOException ex) {
    LOG.warn("String_Node_Str",ex);
  }
}