nus-yam/ex-repair huggingface dataset:
Program: 175259
Project: 175259
Buggy source:
/** 
 * @param languageBo
 * @return
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<LanguageBo> saveForUpdated(@RequestBody LanguageBo languageBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (languageBo.getCode() == null || languageBo.getCode().isEmpty()) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (languageService.findExistLanguageByName(languageBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  languageService.save(languageBo);
  return get(languageBo.getCode());
}

Fixed version (ground truth):
/** 
 * @param languageBo
 * @return
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<LanguageBo> saveForUpdated(@RequestBody LanguageBo languageBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (languageBo.getCode() == null || languageBo.getCode().isEmpty()) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (languageService.findExistLanguageName(languageBo.getName())) {
    if (languageService.findExistLanguageByName(languageBo.getName()).getCode().equals(languageBo.getCode())) {
      languageService.save(languageBo);
    }
 else {
      return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
    }
  }
 else {
    languageService.save(languageBo);
  }
  return get(languageBo.getCode());
}
Program: 175260
Project: 175260
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<LanguageBo> saveForCreated(@RequestBody LanguageBo languageBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (languageService.findExistLanguage(languageBo.getCode())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (languageService.findExistLanguageByName(languageBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  languageService.save(languageBo);
  return get(languageBo.getCode());
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<LanguageBo> saveForCreated(@RequestBody LanguageBo languageBo){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (languageService.findExistLanguage(languageBo.getCode())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (languageService.findExistLanguageName(languageBo.getName())) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  languageService.save(languageBo);
  return get(languageBo.getCode());
}
Program: 175261
Project: 175261
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<SearchBo> saveForUpdated(@RequestBody @Validated SearchBo searchBo,HttpSession session){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (searchBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (searchService.getSearchBoByUri(searchBo.getUri()) != null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  searchBo=searchService.saveSearchBo(searchBo);
  return get(searchBo.getId());
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<SearchBo> saveForUpdated(@RequestBody @Validated SearchBo searchBo,HttpSession session){
  UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
  if (searchBo.getId() == null) {
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  if (searchService.getSearchBoByUri(searchBo.getUri()) != null) {
    if (searchService.getSearchBoByUri(searchBo.getUri()).getId() == searchBo.getId()) {
      searchBo=searchService.saveSearchBo(searchBo);
    }
 else {
      return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
    }
  }
 else {
    searchBo=searchService.saveSearchBo(searchBo);
  }
  return get(searchBo.getId());
}
Program: 175262
Project: 175262
Buggy source:
/** 
 * getModuleToJsp:页面跳转
 * @return
 */
@RequiresPermissions(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView getModuleToJsp(){
  ModelAndView modelAndView=new ModelAndView("String_Node_Str");
  modelAndView.addObject("String_Node_Str",PagingSettingResult.getDefault());
  return modelAndView;
}

Fixed version (ground truth):
/** 
 * getModuleToJsp:页面跳转
 * @return
 */
@RequiresPermissions(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView getModuleToJsp(){
  ModelAndView modelAndView=new ModelAndView("String_Node_Str");
  modelAndView.addObject("String_Node_Str",PagingSettingResult.getDefault());
  modelAndView.addObject(WebConst.PAGE_URI,URI);
  return modelAndView;
}
Program: 175263
Project: 175263
Buggy source:
/** 
 * deleteModuleList:模块设置批量删除
 * @param ids
 * @return
 */
@RequiresPermissions(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<List<ModuleBo>> deleteModuleList(@RequestBody Integer[] ids,HttpSession session){
  if (ids.length == 0) {
    UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  moduleService.deleteModuleList(ids);
  return getModuleList();
}

Fixed version (ground truth):
/** 
 * deleteModuleList:模块设置批量删除
 * @param ids
 * @return
 */
@RequiresPermissions(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<List<ModuleBo>> deleteModuleList(@RequestBody Integer[] ids,HttpSession session){
  if (ids.length == 0) {
    UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  moduleService.deleteModuleList(ids);
  return getModuleList(session);
}
Program: 175264
Project: 175264
Buggy source:
/** 
 * getModuleList:模块设置列表
 * @param
 * @return
 */
@RequiresPermissions(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<List<ModuleBo>> getModuleList(){
  List<ModuleBo> moduleList=moduleService.getModuleList(new Search());
  return JsonResult.success(moduleList);
}

Fixed version (ground truth):
/** 
 * getModuleList:模块设置列表
 * @param
 * @return
 */
@RequiresPermissions(value="String_Node_Str") @RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public JsonResult<List<ModuleBo>> getModuleList(HttpSession session){
  Search search=SearchHelper.getSearchParam(URI,session);
  List<ModuleBo> moduleList=moduleService.getModuleList(search);
  return JsonResult.success(moduleList);
}
Program: 175265
Project: 175265
Buggy source:
@Override public PageMenuBo getPageMenuBo(Integer id){
  PageMenuPo pageMenuPo=pageMenuDao.find(id);
  PageMenuBo pageMenuBo=modelMapper.map(pageMenuPo,PageMenuBo.class);
  List<PageMenuTrlBo> pageMenuTrlBo=modelMapper.map(pageMenuPo.getPageMenuTrlPoList(),new TypeToken<List<PageMenuTrlBo>>(){
  }
.getType());
  List<LanguageBo> languageBoList=languageService.findLanguageListForActivated();
  List<PageMenuTrlBo> pagemenuList=new ArrayList<PageMenuTrlBo>();
  for (  LanguageBo lan : languageBoList) {
    PageMenuTrlBo pagemenu=new PageMenuTrlBo();
    pagemenu.setLanguageCode(lan.getCode());
    if (pageMenuTrlBo.size() > 0) {
      for (      PageMenuTrlBo pm : pageMenuTrlBo) {
        if (lan.getCode().equals(pm.getLanguageCode())) {
          pagemenu.setName(pm.getName());
          pagemenu.setRemark(pm.getRemark());
        }
      }
    }
    pagemenuList.add(pagemenu);
  }
  pageMenuBo.setPageMenuTrlBo(pagemenuList);
  return pageMenuBo;
}

Fixed version (ground truth):
@Override public PageMenuBo getPageMenuBo(Integer id){
  PageMenuPo pageMenuPo=pageMenuDao.find(id);
  PageMenuBo pageMenuBo=modelMapper.map(pageMenuPo,PageMenuBo.class);
  List<PageMenuTrlBo> pageMenuTrlBo=modelMapper.map(pageMenuPo.getPageMenuTrlPoList(),new TypeToken<List<PageMenuTrlBo>>(){
  }
.getType());
  List<LanguageBo> languageBoList=languageService.findLanguageListForActivated();
  List<PageMenuTrlBo> pagemenuList=new ArrayList<PageMenuTrlBo>();
  for (  LanguageBo lan : languageBoList) {
    PageMenuTrlBo pagemenu=new PageMenuTrlBo();
    pagemenu.setLanguageCode(lan.getCode());
    if (pageMenuTrlBo.size() > 0) {
      for (      PageMenuTrlBo pm : pageMenuTrlBo) {
        if (lan.getCode().equals(pm.getLanguageCode())) {
          pagemenu.setId(pm.getId());
          pagemenu.setName(pm.getName());
          pagemenu.setRemark(pm.getRemark());
        }
      }
    }
    pagemenuList.add(pagemenu);
  }
  pageMenuBo.setPageMenuTrlBo(pagemenuList);
  return pageMenuBo;
}
Program: 175266
Project: 175266
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<List<PageMenuBo>> deletes(@RequestBody Integer[] ids,HttpSession session){
  if (ids == null) {
    UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  pageMenuService.deleteMenuById(ids);
  return list(session);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<List<PageMenuBo>> deletes(@RequestBody Integer[] ids,HttpSession session){
  if (ids == null) {
    UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
  for (  Integer id : ids) {
    Search search=new Search();
    search.addFilterEqual("String_Node_Str",id);
    List<PageMenuBo> pageMenuBos=pageMenuService.findPageMenu(search);
    if (pageMenuBos.size() > 0) {
      UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
      return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
    }
  }
  pageMenuService.deleteMenuById(ids);
  return list(session);
}
Program: 175267
Project: 175267
Buggy source:
/** 
 * getListMenuType:获取父菜单列表
 * @return
 * @author :Bobo
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<List<PageMenuBo>> getListMenuType(){
  List<PageMenuBo> pageMenuBoList=pageMenuService.getListMenuType();
  return JsonResult.success(pageMenuBoList);
}

Fixed version (ground truth):
/** 
 * getListMenuType:获取父菜单列表
 * @return
 * @author :Bobo
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<List<PageMenuBo>> getListMenuType(){
  List<PageMenuBo> pageMenuBoList=pageMenuService.getListMenuType();
  PageMenuBo pageMenuBo=new PageMenuBo();
  pageMenuBo.setId(null);
  pageMenuBo.setName("String_Node_Str");
  pageMenuBoList.add(0,pageMenuBo);
  return JsonResult.success(pageMenuBoList);
}
Program: 175268
Project: 175268
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<PageMenuBo> get(Integer id,HttpSession session){
  PageMenuBo pageMenuBo=null;
  if (id == null) {
    UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
 else {
    pageMenuBo=pageMenuService.getPageMenuBo(id);
  }
  return JsonResult.success(pageMenuBo);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) @ResponseBody @RequiresPermissions(value="String_Node_Str") public JsonResult<PageMenuBo> get(Integer id,HttpSession session){
  PageMenuBo pageMenuBo=null;
  if (id == null) {
    UserResource resource=(UserResource)session.getAttribute(WebConst.SESSION_RESOURCE);
    return JsonResult.fail(ErrorCodes.BUSINESS_EXCEPTION.getCode(),resource.getMessage("String_Node_Str"));
  }
 else {
    pageMenuBo=pageMenuService.getPageMenuBo(id);
    pageMenuBo.setIsCheck("String_Node_Str");
  }
  return JsonResult.success(pageMenuBo);
}
Program: 175269
Project: 175269
Buggy source:
@Override public void onAnimationUpdate(ValueAnimator animation){
  int update=(int)(animation.getAnimatedValue());
  int incr=360 / maxProgress;
  int value=(update / incr);
  progressUpdate=update;
  progressText=value + "String_Node_Str";
  invalidate();
}

Fixed version (ground truth):
@Override public void onAnimationUpdate(ValueAnimator animation){
  float update=(float)(animation.getAnimatedValue());
  float incr=360 / maxProgress;
  float value=(update / incr);
  progressUpdate=update;
  progressText=((int)value) + "String_Node_Str";
  invalidate();
}
Program: 175270
Project: 175270
Buggy source:
public void setProgress(int progress){
  lastProgress=this.progress;
  this.progress=progress;
  post(new Runnable(){
    @Override public void run(){
      int incr=360 / maxProgress;
      Log.e("String_Node_Str","String_Node_Str" + lastProgress + "String_Node_Str"+ BatteryProgressView.this.progress);
      if (lastProgress < BatteryProgressView.this.progress) {
        Log.e("String_Node_Str",lastProgress + "String_Node_Str" + (incr * (BatteryProgressView.this.progress))+ "String_Node_Str"+ lastProgress);
        animator=ValueAnimator.ofInt(incr * lastProgress,incr * (BatteryProgressView.this.progress));
        animator.setDuration(800);
        animator.addUpdateListener(animatorUpdateListener);
        animator.setInterpolator(new DecelerateInterpolator());
        animator.start();
      }
 else {
        Log.e("String_Node_Str",lastProgress + "String_Node_Str" + (incr * (BatteryProgressView.this.progress))+ "String_Node_Str"+ lastProgress);
        animator=ValueAnimator.ofInt((incr * lastProgress),incr * (BatteryProgressView.this.progress));
        animator.setDuration(800);
        animator.addUpdateListener(animatorUpdateListener);
        animator.setInterpolator(new DecelerateInterpolator());
        animator.start();
      }
    }
  }
);
}

Fixed version (ground truth):
public void setProgress(int progress){
  lastProgress=this.progress;
  this.progress=progress;
  post(new Runnable(){
    @Override public void run(){
      float incr=360 / maxProgress;
      Log.e("String_Node_Str","String_Node_Str" + lastProgress + "String_Node_Str"+ BatteryProgressView.this.progress);
      if (lastProgress < BatteryProgressView.this.progress) {
        Log.e("String_Node_Str",lastProgress + "String_Node_Str" + (incr * (BatteryProgressView.this.progress))+ "String_Node_Str"+ lastProgress);
        animator=ValueAnimator.ofFloat(incr * lastProgress,incr * (BatteryProgressView.this.progress));
        animator.setDuration(800);
        animator.addUpdateListener(animatorUpdateListener);
        animator.setInterpolator(new DecelerateInterpolator());
        animator.start();
      }
 else {
        Log.e("String_Node_Str",lastProgress + "String_Node_Str" + (incr * (BatteryProgressView.this.progress))+ "String_Node_Str"+ lastProgress);
        animator=ValueAnimator.ofFloat((incr * lastProgress),incr * (BatteryProgressView.this.progress));
        animator.setDuration(800);
        animator.addUpdateListener(animatorUpdateListener);
        animator.setInterpolator(new DecelerateInterpolator());
        animator.start();
      }
    }
  }
);
}
Program: 175271
Project: 175271
Buggy source:
@Override public void run(){
  int incr=360 / maxProgress;
  Log.e("String_Node_Str","String_Node_Str" + lastProgress + "String_Node_Str"+ BatteryProgressView.this.progress);
  if (lastProgress < BatteryProgressView.this.progress) {
    Log.e("String_Node_Str",lastProgress + "String_Node_Str" + (incr * (BatteryProgressView.this.progress))+ "String_Node_Str"+ lastProgress);
    animator=ValueAnimator.ofInt(incr * lastProgress,incr * (BatteryProgressView.this.progress));
    animator.setDuration(800);
    animator.addUpdateListener(animatorUpdateListener);
    animator.setInterpolator(new DecelerateInterpolator());
    animator.start();
  }
 else {
    Log.e("String_Node_Str",lastProgress + "String_Node_Str" + (incr * (BatteryProgressView.this.progress))+ "String_Node_Str"+ lastProgress);
    animator=ValueAnimator.ofInt((incr * lastProgress),incr * (BatteryProgressView.this.progress));
    animator.setDuration(800);
    animator.addUpdateListener(animatorUpdateListener);
    animator.setInterpolator(new DecelerateInterpolator());
    animator.start();
  }
}

Fixed version (ground truth):
@Override public void run(){
  float incr=360 / maxProgress;
  Log.e("String_Node_Str","String_Node_Str" + lastProgress + "String_Node_Str"+ BatteryProgressView.this.progress);
  if (lastProgress < BatteryProgressView.this.progress) {
    Log.e("String_Node_Str",lastProgress + "String_Node_Str" + (incr * (BatteryProgressView.this.progress))+ "String_Node_Str"+ lastProgress);
    animator=ValueAnimator.ofFloat(incr * lastProgress,incr * (BatteryProgressView.this.progress));
    animator.setDuration(800);
    animator.addUpdateListener(animatorUpdateListener);
    animator.setInterpolator(new DecelerateInterpolator());
    animator.start();
  }
 else {
    Log.e("String_Node_Str",lastProgress + "String_Node_Str" + (incr * (BatteryProgressView.this.progress))+ "String_Node_Str"+ lastProgress);
    animator=ValueAnimator.ofFloat((incr * lastProgress),incr * (BatteryProgressView.this.progress));
    animator.setDuration(800);
    animator.addUpdateListener(animatorUpdateListener);
    animator.setInterpolator(new DecelerateInterpolator());
    animator.start();
  }
}
Program: 175272
Project: 175272
Buggy source:
@Test public void createNamedQueryWhere(){
  UserInfo userInfo=ebeanQueryChannelService.createNamedQuery(UserInfo.class,"String_Node_Str").where().eq("String_Node_Str","String_Node_Str").findUnique();
  assertEquals("String_Node_Str",userInfo.getFirstName());
  assertEquals("String_Node_Str",userInfo.getEmailAddress());
}

Fixed version (ground truth):
@Test public void createNamedQueryWhere(){
  UserInfo userInfo=ebeanQueryChannelService.createNamedQuery(UserInfo.class,"String_Node_Str").where().eq("String_Node_Str","String_Node_Str").findOne();
  assertEquals("String_Node_Str",userInfo.getFirstName());
  assertEquals("String_Node_Str",userInfo.getEmailAddress());
}
Program: 175273
Project: 175273
Buggy source:
/** 
 * Convert spring data Sort to Ebean OrderBy.
 * @param sort
 * @param < T >
 * @return
 */
public static <T>OrderBy<T> convertToEbeanOrder(Sort sort){
  List<String> list=new ArrayList<>();
  while (sort.iterator().hasNext()) {
    Sort.Order so=sort.iterator().next();
    list.add(so.getDirection() == Sort.Direction.ASC ? so.getProperty() + "String_Node_Str" : so.getProperty() + "String_Node_Str");
  }
  return new OrderBy<T>(StringUtils.collectionToCommaDelimitedString(list));
}

Fixed version (ground truth):
/** 
 * Convert spring data Sort to Ebean OrderBy.
 * @param sort
 * @param < T >
 * @return
 */
public static <T>OrderBy<T> convertToEbeanOrder(Sort sort){
  if (sort == null) {
    return null;
  }
  List<String> list=new ArrayList<>();
  while (sort.iterator().hasNext()) {
    Sort.Order so=sort.iterator().next();
    list.add(so.getDirection() == Sort.Direction.ASC ? so.getProperty() + "String_Node_Str" : so.getProperty() + "String_Node_Str");
  }
  return new OrderBy<T>(StringUtils.collectionToCommaDelimitedString(list));
}
Program: 175274
Project: 175274
Buggy source:
/** 
 * This method will be called if some permissions have previously been set not to ask again.
 * @param context     the android context.
 * @param blockedList the list of permissions which have been set not to ask again.
 * @return The overrider of this method should return true if no further action is needed,and should return false if the default action is to be taken, i.e. send user to settings. <br><br> Note: If the option  {@link Permissions.Options#sendDontAskAgainToSettings(boolean)} has beenset to false, the user won't be sent to settings by default.
 */
@SuppressWarnings("String_Node_Str") public boolean onBlocked(Context context,ArrayList<String> blockedList){
  if (Permissions.loggingEnabled) {
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str");
    for (    String permission : blockedList) {
      builder.append("String_Node_Str");
      builder.append(permission);
    }
    Permissions.log(builder.toString());
  }
  return false;
}

Fixed version (ground truth):
/** 
 * This method will be called if some permissions have previously been set not to ask again.
 * @param context     the application context.
 * @param blockedList the list of permissions which have been set not to ask again.
 * @return The overrider of this method should return true if no further action is needed,and should return false if the default action is to be taken, i.e. send user to settings. <br><br> Note: If the option  {@link Permissions.Options#sendDontAskAgainToSettings(boolean)} has beenset to false, the user won't be sent to settings by default.
 */
@SuppressWarnings("String_Node_Str") public boolean onBlocked(Context context,ArrayList<String> blockedList){
  if (Permissions.loggingEnabled) {
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str");
    for (    String permission : blockedList) {
      builder.append("String_Node_Str");
      builder.append(permission);
    }
    Permissions.log(builder.toString());
  }
  return false;
}
Program: 175275
Project: 175275
Buggy source:
/** 
 * This method will be called if some of the requested permissions have been denied.
 * @param context           The android context.
 * @param deniedPermissions The list of permissions which have been denied.
 */
public void onDenied(Context context,ArrayList<String> deniedPermissions){
  if (Permissions.loggingEnabled) {
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str");
    for (    String permission : deniedPermissions) {
      builder.append("String_Node_Str");
      builder.append(permission);
    }
    Permissions.log(builder.toString());
  }
  Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}

Fixed version (ground truth):
/** 
 * This method will be called if some of the requested permissions have been denied.
 * @param context           The application context.
 * @param deniedPermissions The list of permissions which have been denied.
 */
public void onDenied(Context context,ArrayList<String> deniedPermissions){
  if (Permissions.loggingEnabled) {
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str");
    for (    String permission : deniedPermissions) {
      builder.append("String_Node_Str");
      builder.append(permission);
    }
    Permissions.log(builder.toString());
  }
  Toast.makeText(context,"String_Node_Str",Toast.LENGTH_SHORT).show();
}
Program: 175276
Project: 175276
Buggy source:
/** 
 * This method will be called if some permissions have just been set not to ask again.
 * @param context           The android context.
 * @param justBlockedList   The list of permissions which have just been set not to ask again.
 * @param deniedPermissions The list of currently unavailable permissions.
 */
public void onJustBlocked(Context context,ArrayList<String> justBlockedList,ArrayList<String> deniedPermissions){
  if (Permissions.loggingEnabled) {
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str");
    for (    String permission : justBlockedList) {
      builder.append("String_Node_Str");
      builder.append(permission);
    }
    Permissions.log(builder.toString());
  }
  onDenied(context,deniedPermissions);
}

Fixed version (ground truth):
/** 
 * This method will be called if some permissions have just been set not to ask again.
 * @param context           The application context.
 * @param justBlockedList   The list of permissions which have just been set not to ask again.
 * @param deniedPermissions The list of currently unavailable permissions.
 */
public void onJustBlocked(Context context,ArrayList<String> justBlockedList,ArrayList<String> deniedPermissions){
  if (Permissions.loggingEnabled) {
    StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str");
    for (    String permission : justBlockedList) {
      builder.append("String_Node_Str");
      builder.append(permission);
    }
    Permissions.log(builder.toString());
  }
  onDenied(context,deniedPermissions);
}
Program: 175277
Project: 175277
Buggy source:
@TargetApi(Build.VERSION_CODES.M) @Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  if (intent == null || !intent.hasExtra(EXTRA_PERMISSIONS)) {
    finish();
    return;
  }
  getWindow().setStatusBarColor(0);
  allPermissions=(ArrayList<String>)intent.getSerializableExtra(EXTRA_PERMISSIONS);
  options=(Permissions.Options)intent.getSerializableExtra(EXTRA_OPTIONS);
  if (options == null) {
    options=new Permissions.Options();
  }
  deniedPermissions=new ArrayList<>();
  noRationaleList=new ArrayList<>();
  boolean noRationale=true;
  for (  String permission : allPermissions) {
    if (checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
      deniedPermissions.add(permission);
      if (shouldShowRequestPermissionRationale(permission)) {
        noRationale=false;
      }
 else {
        noRationaleList.add(permission);
      }
    }
  }
  String rationale=intent.getStringExtra(EXTRA_RATIONALE);
  if (noRationale || TextUtils.isEmpty(rationale)) {
    Permissions.log("String_Node_Str");
    requestPermissions(deniedPermissions.toArray(new String[0]),RC_PERMISSION);
  }
 else {
    Permissions.log("String_Node_Str");
    showRationale(rationale);
  }
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.M) @Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=getIntent();
  if (intent == null || !intent.hasExtra(EXTRA_PERMISSIONS)) {
    finish();
    return;
  }
  getWindow().setStatusBarColor(0);
  allPermissions=(ArrayList<String>)intent.getSerializableExtra(EXTRA_PERMISSIONS);
  options=(Permissions.Options)intent.getSerializableExtra(EXTRA_OPTIONS);
  if (options == null) {
    options=new Permissions.Options();
  }
  deniedPermissions=new ArrayList<>();
  noRationaleList=new ArrayList<>();
  boolean noRationale=true;
  for (  String permission : allPermissions) {
    if (checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
      deniedPermissions.add(permission);
      if (shouldShowRequestPermissionRationale(permission)) {
        noRationale=false;
      }
 else {
        noRationaleList.add(permission);
      }
    }
  }
  if (deniedPermissions.isEmpty()) {
    grant();
    return;
  }
  String rationale=intent.getStringExtra(EXTRA_RATIONALE);
  if (noRationale || TextUtils.isEmpty(rationale)) {
    Permissions.log("String_Node_Str");
    requestPermissions(toArray(deniedPermissions),RC_PERMISSION);
  }
 else {
    Permissions.log("String_Node_Str");
    showRationale(rationale);
  }
}
Program: 175278
Project: 175278
Buggy source:
private void deny(){
  if (permissionHandler != null) {
    permissionHandler.onDenied(this,deniedPermissions);
  }
  finish();
}

Fixed version (ground truth):
private void deny(){
  if (permissionHandler != null) {
    permissionHandler.onDenied(getApplicationContext(),deniedPermissions);
  }
  finish();
}
Program: 175279
Project: 175279
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void onRequestPermissionsResult(int requestCode,String[] permissions,int[] grantResults){
  if (grantResults.length == 0) {
    deny();
  }
 else {
    deniedPermissions.clear();
    for (int i=0; i < grantResults.length; i++) {
      if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
        deniedPermissions.add(permissions[i]);
      }
    }
    if (deniedPermissions.size() == 0) {
      Permissions.log("String_Node_Str");
      grant();
    }
 else {
      ArrayList<String> blockedList=new ArrayList<>();
      ArrayList<String> justBlockedList=new ArrayList<>();
      ArrayList<String> justDeniedList=new ArrayList<>();
      for (      String permission : deniedPermissions) {
        if (shouldShowRequestPermissionRationale(permission)) {
          justDeniedList.add(permission);
        }
 else {
          blockedList.add(permission);
          if (!noRationaleList.contains(permission)) {
            justBlockedList.add(permission);
          }
        }
      }
      if (justBlockedList.size() > 0) {
        if (permissionHandler != null) {
          permissionHandler.onJustBlocked(this,justBlockedList,deniedPermissions);
        }
        finish();
      }
 else       if (justDeniedList.size() > 0) {
        deny();
      }
 else {
        if (permissionHandler != null && !permissionHandler.onBlocked(this,blockedList)) {
          sendToSettings();
        }
 else         finish();
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void onRequestPermissionsResult(int requestCode,String[] permissions,int[] grantResults){
  if (grantResults.length == 0) {
    deny();
  }
 else {
    deniedPermissions.clear();
    for (int i=0; i < grantResults.length; i++) {
      if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
        deniedPermissions.add(permissions[i]);
      }
    }
    if (deniedPermissions.size() == 0) {
      Permissions.log("String_Node_Str");
      grant();
    }
 else {
      ArrayList<String> blockedList=new ArrayList<>();
      ArrayList<String> justBlockedList=new ArrayList<>();
      ArrayList<String> justDeniedList=new ArrayList<>();
      for (      String permission : deniedPermissions) {
        if (shouldShowRequestPermissionRationale(permission)) {
          justDeniedList.add(permission);
        }
 else {
          blockedList.add(permission);
          if (!noRationaleList.contains(permission)) {
            justBlockedList.add(permission);
          }
        }
      }
      if (justBlockedList.size() > 0) {
        if (permissionHandler != null) {
          permissionHandler.onJustBlocked(getApplicationContext(),justBlockedList,deniedPermissions);
        }
        finish();
      }
 else       if (justDeniedList.size() > 0) {
        deny();
      }
 else {
        if (permissionHandler != null && !permissionHandler.onBlocked(getApplicationContext(),blockedList)) {
          sendToSettings();
        }
 else         finish();
      }
    }
  }
}
Program: 175280
Project: 175280
Buggy source:
private void showRationale(String rationale){
  DialogInterface.OnClickListener listener=new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      if (which == DialogInterface.BUTTON_POSITIVE) {
        requestPermissions(deniedPermissions.toArray(new String[0]),RC_PERMISSION);
      }
 else {
        deny();
      }
    }
  }
;
  new AlertDialog.Builder(this).setTitle(options.rationaleDialogTitle).setMessage(rationale).setPositiveButton(android.R.string.ok,listener).setNegativeButton(android.R.string.cancel,listener).setOnCancelListener(new DialogInterface.OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      deny();
    }
  }
).create().show();
}

Fixed version (ground truth):
private void showRationale(String rationale){
  DialogInterface.OnClickListener listener=new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      if (which == DialogInterface.BUTTON_POSITIVE) {
        requestPermissions(toArray(deniedPermissions),RC_PERMISSION);
      }
 else {
        deny();
      }
    }
  }
;
  new AlertDialog.Builder(this).setTitle(options.rationaleDialogTitle).setMessage(rationale).setPositiveButton(android.R.string.ok,listener).setNegativeButton(android.R.string.cancel,listener).setOnCancelListener(new DialogInterface.OnCancelListener(){
    @Override public void onCancel(    DialogInterface dialog){
      deny();
    }
  }
).create().show();
}
Program: 175281
Project: 175281
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == RC_SETTINGS && permissionHandler != null) {
    Permissions.check(this,allPermissions.toArray(new String[0]),null,options,permissionHandler);
    cleanHandlerOnDestroy=false;
  }
  finish();
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == RC_SETTINGS && permissionHandler != null) {
    Permissions.check(this,toArray(allPermissions),null,options,permissionHandler);
    cleanHandlerOnDestroy=false;
  }
  finish();
}
Program: 175282
Project: 175282
Buggy source:
public void start(){
  try {
    FileChannel fileChannel=new RandomAccessFile(Constants.RESULT_HOME + File.separator + Constants.RESULT_FILE_NAME,"String_Node_Str").getChannel();
    nativeClient.start(fileChannel);
    fileChannel.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void start(){
  try {
    FileChannel fileChannel=new RandomAccessFile(Constants.RESULT_HOME + File.separator + Constants.RESULT_FILE_NAME,"String_Node_Str").getChannel();
    nativeClient.start(fileChannel);
    fileChannel.close();
    System.exit(0);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 175283
Project: 175283
Buggy source:
void compute(){
  while (nextIndex < endIndex) {
    localOperations.add(scanOneRecord());
  }
}

Fixed version (ground truth):
void compute(){
  while (nextIndex < endIndex) {
    LogOperation logOperation=scanOneRecord();
    if (logOperation != null) {
      localOperations.add(logOperation);
    }
  }
}
Program: 175284
Project: 175284
Buggy source:
void waitForSend() throws InterruptedException, ExecutionException {
  LogOperation[] logOperations=localOperations.toArray(new LogOperation[0]);
  prevFuture.get();
  PipelinedComputation.blockingQueue.put(logOperations);
}

Fixed version (ground truth):
void waitForSend() throws InterruptedException, ExecutionException {
  LogOperation[] logOperations=localOperations.toArray(new LogOperation[0]);
  localOperations.clear();
  prevFuture.get();
  if (logOperations.length != 0)   PipelinedComputation.blockingQueue.put(logOperations);
}
Program: 175286
Project: 175286
Buggy source:
@Override public void act(){
  InsertOperation insertOperation=(InsertOperation)recordMap.get(this);
  if (PipelinedComputation.isKeyInRange(this.relevantKey)) {
    inRangeRecordSet.remove(this);
  }
  insertOperation.changePK(this.changedKey);
  recordMap.put(insertOperation);
  if (PipelinedComputation.isKeyInRange(insertOperation.relevantKey)) {
    inRangeRecordSet.add(insertOperation);
  }
}

Fixed version (ground truth):
@Override public void act(){
  if (PipelinedComputation.isKeyInRange(this.relevantKey)) {
    inRangeRecordSet.remove(this);
  }
  InsertOperation insertOperation=new InsertOperation(this.changedKey);
  recordMap.put(insertOperation);
  if (PipelinedComputation.isKeyInRange(insertOperation.relevantKey)) {
    inRangeRecordSet.add(insertOperation);
  }
}
Program: 175287
Project: 175287
Buggy source:
public static void main(String[] args){
  logger.info("String_Node_Str" + System.currentTimeMillis());
  new Client(args[0]).start();
  logger.info("String_Node_Str" + System.currentTimeMillis());
}

Fixed version (ground truth):
public static void main(String[] args){
  initProperties();
  logger=LoggerFactory.getLogger(Client.class);
  logger.info("String_Node_Str" + System.currentTimeMillis());
  new Client(args[0]).start();
  logger.info("String_Node_Str" + System.currentTimeMillis());
}
Program: 175288
Project: 175288
Buggy source:
public Client(String ip){
  initProperties();
  logger=LoggerFactory.getLogger(Client.class);
  nativeClient=new NioClient(ip,Constants.SERVER_PORT);
}

Fixed version (ground truth):
public Client(String ip){
  nativeClient=new NioClient(ip,Constants.SERVER_PORT);
}
Program: 175289
Project: 175289
Buggy source:
private void fetchNextMmapChunk() throws IOException {
  currChunkLength=nextIndex != maxIndex ? CHUNK_SIZE : lastChunkLength;
  if (mappedByteBuffer != null) {
    unmap(mappedByteBuffer);
  }
  mappedByteBuffer=fileChannel.map(FileChannel.MapMode.READ_ONLY,nextIndex * CHUNK_SIZE,currChunkLength);
  mappedByteBuffer.load();
}

Fixed version (ground truth):
private void fetchNextMmapChunk() throws IOException {
  currChunkLength=nextIndex != maxIndex ? CHUNK_SIZE : lastChunkLength;
  if (mappedByteBuffer != null) {
    unmap(mappedByteBuffer);
  }
  mappedByteBuffer=fileChannel.map(FileChannel.MapMode.READ_ONLY,nextIndex * CHUNK_SIZE,currChunkLength);
  mappedByteBuffer.load();
  if (RecordField.isInit()) {
    new RecordField(mappedByteBuffer).initFieldIndexMap();
  }
}
Program: 175290
Project: 175290
Buggy source:
public static void initRecordField() throws IOException {
  MappedByteBuffer mappedByteBuffer;
  FileChannel fileChannel=new RandomAccessFile("String_Node_Str","String_Node_Str").getChannel();
  mappedByteBuffer=fileChannel.map(FileChannel.MapMode.READ_ONLY,0,1024 * 1024);
  mappedByteBuffer.load();
  if (!RecordField.isInit())   new RecordField(mappedByteBuffer).initFieldIndexMap();
  FileUtil.unmap(mappedByteBuffer);
  for (  Map.Entry<ByteBuffer,Integer> entry : fieldIndexMap.entrySet()) {
    System.out.println("String_Node_Str" + new String(entry.getKey().array()) + "String_Node_Str"+ entry.getValue());
  }
}

Fixed version (ground truth):
static void initRecordField() throws IOException {
  MappedByteBuffer mappedByteBuffer;
  FileChannel fileChannel=new RandomAccessFile("String_Node_Str","String_Node_Str").getChannel();
  mappedByteBuffer=fileChannel.map(FileChannel.MapMode.READ_ONLY,0,1024 * 1024);
  mappedByteBuffer.load();
  if (!RecordField.isInit())   new RecordField(mappedByteBuffer).initFieldIndexMap();
  FileUtil.unmap(mappedByteBuffer);
  for (  Map.Entry<ByteBuffer,Integer> entry : fieldIndexMap.entrySet()) {
    System.out.println("String_Node_Str" + new String(entry.getKey().array()) + "String_Node_Str"+ entry.getValue());
  }
}
Program: 175291
Project: 175291
Buggy source:
public static void main(String[] args) throws IOException {
  RecordFieldTest.initRecordField();
  StringBuilder stringBuilder=new StringBuilder("String_Node_Str").append('\n');
  stringBuilder.append("String_Node_Str").append('\n');
  stringBuilder.append("String_Node_Str").append('\n');
  byte[] myBytes=stringBuilder.toString().getBytes();
  System.out.println("String_Node_Str" + new String(myBytes));
  ByteBuffer byteBuffer=ByteBuffer.wrap(myBytes);
  ByteBuffer retByteBuffer=ByteBuffer.allocate(1024 * 1024);
  ArrayList<RecordKeyValuePair> recordKeyValuePairArrayList=new ArrayList<>();
  RecordScanner recordScanner=new RecordScanner(byteBuffer,0,byteBuffer.limit(),retByteBuffer,recordKeyValuePairArrayList);
  recordScanner.compute();
  retByteBuffer.flip();
  System.out.println(new String(retByteBuffer.array(),0,retByteBuffer.limit()));
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  RecordFieldTest.initRecordField();
  StringBuilder stringBuilder=new StringBuilder("String_Node_Str").append('\n');
  stringBuilder.append("String_Node_Str").append('\n');
  stringBuilder.append("String_Node_Str").append('\n');
  stringBuilder.append("String_Node_Str").append('\n');
  stringBuilder.append("String_Node_Str").append('\n');
  byte[] myBytes=stringBuilder.toString().getBytes();
  System.out.println("String_Node_Str" + new String(myBytes));
  ByteBuffer byteBuffer=ByteBuffer.wrap(myBytes);
  ByteBuffer retByteBuffer=ByteBuffer.allocate(1024 * 1024);
  ArrayList<RecordKeyValuePair> recordKeyValuePairArrayList=new ArrayList<>();
  RecordScanner recordScanner=new RecordScanner(byteBuffer,0,byteBuffer.limit(),retByteBuffer,recordKeyValuePairArrayList);
  recordScanner.compute();
  RecordScanner recordScanner2=new RecordScanner(byteBuffer,0,byteBuffer.limit(),retByteBuffer,recordKeyValuePairArrayList);
  recordScanner2.compute();
  retByteBuffer.flip();
  System.out.println(new String(retByteBuffer.array(),0,retByteBuffer.limit()));
  for (  RecordKeyValuePair recordKeyValuePair : recordKeyValuePairArrayList) {
    ObjectMapper mapper=new ObjectMapper();
    String jsonInString=mapper.writerWithDefaultPrettyPrinter().writeValueAsString(recordKeyValuePair);
    System.out.println(jsonInString);
  }
}
Program: 175292
Project: 175292
Buggy source:
RecordKeyValuePair(KeyOperation keyOperation,ValueIndexArrWrapper valueIndexArrWrapper){
  this.keyOperation=keyOperation;
  this.valueIndexArrWrapper=valueIndexArrWrapper;
}

Fixed version (ground truth):
public RecordKeyValuePair(KeyOperation keyOperation,ValueIndexArrWrapper valueIndexArrWrapper){
  this.keyOperation=keyOperation;
  this.valueIndexArrWrapper=valueIndexArrWrapper;
}
Program: 175293
Project: 175293
Buggy source:
void compute(){
  while (nextIndex < endIndex) {
    recordWrapperArrayList.add(scanOneRecord());
  }
}

Fixed version (ground truth):
public void compute(){
  while (nextIndex < endIndex) {
    recordWrapperArrayList.add(scanOneRecord());
  }
}
Program: 175294
Project: 175294
Buggy source:
private void putIntoByteBufferUntilFieldSplitter(){
  byte myByte;
  while ((myByte=mappedByteBuffer.get(nextIndex)) != FILED_SPLITTER) {
    retByteBuffer.put(myByte);
    nextIndex++;
  }
  retByteBuffer.put(mappedByteBuffer.get(nextIndex));
  nextIndex++;
}

Fixed version (ground truth):
private void putIntoByteBufferUntilFieldSplitter(){
  if (mappedByteBuffer.get(nextIndex) == FILED_SPLITTER) {
    nextIndex++;
  }
  byte myByte;
  while ((myByte=mappedByteBuffer.get(nextIndex)) != FILED_SPLITTER) {
    retByteBuffer.put(myByte);
    nextIndex++;
  }
  retByteBuffer.put(LINE_SPLITTER);
}
Program: 175295
Project: 175295
Buggy source:
RecordScanner(ByteBuffer mappedByteBuffer,int startIndex,int endIndex,ByteBuffer retByteBuffer,ArrayList<RecordKeyValuePair> retRecordWrapperArrayList){
  this.mappedByteBuffer=mappedByteBuffer.asReadOnlyBuffer();
  this.nextIndex=startIndex;
  this.endIndex=endIndex;
  this.retByteBuffer=retByteBuffer;
  this.recordWrapperArrayList=retRecordWrapperArrayList;
}

Fixed version (ground truth):
public RecordScanner(ByteBuffer mappedByteBuffer,int startIndex,int endIndex,ByteBuffer retByteBuffer,ArrayList<RecordKeyValuePair> retRecordWrapperArrayList){
  this.mappedByteBuffer=mappedByteBuffer.asReadOnlyBuffer();
  this.nextIndex=startIndex;
  this.endIndex=endIndex;
  this.retByteBuffer=retByteBuffer;
  this.recordWrapperArrayList=retRecordWrapperArrayList;
}
Program: 175296
Project: 175296
Buggy source:
private RecordKeyValuePair scanOneRecord(){
  for (int i=0; i < 4; i++) {
    skipField();
  }
  byte operation=mappedByteBuffer.get(nextIndex + 1);
  nextIndex+=2;
  KeyOperation keyOperation=new KeyOperation(operation);
  skipField();
  if (operation == I_OPERATION) {
    skipField();
    keyOperation.curKey(getNextLong());
  }
 else   if (operation == D_OPERATION) {
    keyOperation.preKey(getNextLong());
    skipField();
  }
 else {
    keyOperation.preKey(getNextLong());
    keyOperation.curKey(getNextLong());
  }
  ValueIndexArrWrapper valueIndexArrWrapper=null;
  while (mappedByteBuffer.get(nextIndex + 1) != LINE_SPLITTER) {
    if (valueIndexArrWrapper == null) {
      valueIndexArrWrapper=new ValueIndexArrWrapper();
    }
    skipFieldNameAndUpdateStates();
    long curOffset=retByteBuffer.limit();
    skipField();
    putIntoByteBufferUntilFieldSplitter();
    long nextOffset=retByteBuffer.limit();
    valueIndexArrWrapper.addIndex(mappedByteBuffer,curOffset,(short)(nextOffset - curOffset));
  }
  return new RecordKeyValuePair(keyOperation,valueIndexArrWrapper);
}

Fixed version (ground truth):
private RecordKeyValuePair scanOneRecord(){
  for (int i=0; i < 4; i++) {
    skipField();
  }
  byte operation=mappedByteBuffer.get(nextIndex + 1);
  nextIndex+=2;
  KeyOperation keyOperation=new KeyOperation(operation);
  skipField();
  if (operation == I_OPERATION) {
    skipField();
    keyOperation.curKey(getNextLong());
  }
 else   if (operation == D_OPERATION) {
    keyOperation.preKey(getNextLong());
    skipField();
  }
 else {
    keyOperation.preKey(getNextLong());
    keyOperation.curKey(getNextLong());
  }
  ValueIndexArrWrapper valueIndexArrWrapper=null;
  while (mappedByteBuffer.get(nextIndex + 1) != LINE_SPLITTER) {
    if (valueIndexArrWrapper == null) {
      valueIndexArrWrapper=new ValueIndexArrWrapper();
    }
    skipFieldName();
    long curOffset=retByteBuffer.position();
    skipField();
    putIntoByteBufferUntilFieldSplitter();
    long nextOffset=retByteBuffer.position();
    valueIndexArrWrapper.addIndex(fieldNameBuffer,curOffset,(short)(nextOffset - curOffset));
  }
  nextIndex+=2;
  return new RecordKeyValuePair(keyOperation,valueIndexArrWrapper);
}
Program: 175297
Project: 175297
Buggy source:
ValueIndexArrWrapper(){
  valueIndexArr=new IndexPair[RecordField.FILED_NUM];
  for (  IndexPair indexPair : valueIndexArr) {
    System.out.println(indexPair);
  }
}

Fixed version (ground truth):
ValueIndexArrWrapper(){
  valueIndexArr=new IndexPair[RecordField.FILED_NUM];
}
Program: 175298
Project: 175298
Buggy source:
void addIndex(ByteBuffer keyBytes,long offset,short length){
  valueIndexArr[RecordField.fieldIndexMap.get(keyBytes)]=new IndexPair(offset,length);
}

Fixed version (ground truth):
void addIndex(ByteBuffer keyBytes,long offset,short length){
  System.out.println("String_Node_Str" + RecordField.fieldIndexMap.get(keyBytes) + "String_Node_Str"+ new String(keyBytes.array(),0,keyBytes.limit()));
  valueIndexArr[RecordField.fieldIndexMap.get(keyBytes)]=new IndexPair(offset,length);
}
Program: 175299
Project: 175299
Buggy source:
public static void main(String[] args) throws IOException {
  MappedByteBuffer mappedByteBuffer;
  FileChannel fileChannel=new RandomAccessFile("String_Node_Str","String_Node_Str").getChannel();
  mappedByteBuffer=fileChannel.map(FileChannel.MapMode.READ_ONLY,0,1024 * 1024);
  mappedByteBuffer.load();
  if (!RecordField.isInit())   new RecordField(mappedByteBuffer).initFieldIndexMap();
  FileUtil.unmap(mappedByteBuffer);
  for (  Map.Entry<ByteBuffer,Integer> entry : fieldIndexMap.entrySet()) {
    System.out.println(new String(entry.getKey().array()) + "String_Node_Str" + entry.getValue());
  }
  System.out.println("String_Node_Str" + RecordField.FILED_NUM);
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  initRecordField();
  System.out.println("String_Node_Str" + RecordField.FILED_NUM);
}