nus-yam/ex-repair huggingface dataset:
Program: 57681
Project: 57681
Buggy source:
/** 
 * 获得具有层次关系的讨论话题列表.
 * @return 包含讨论话题及其继承关系的Map对象
 */
public Map<DiscussionTopic,List<DiscussionTopic>> getDiscussionTopicsWithHierarchy(){
  List<DiscussionTopic> DiscussionTopics=getDiscussionTopics();
  Map<Integer,List<DiscussionTopic>> DiscussionTopicsIndexer=new HashMap<Integer,List<DiscussionTopic>>();
  Map<DiscussionTopic,List<DiscussionTopic>> DiscussionTopicsHierarchy=new HashMap<DiscussionTopic,List<DiscussionTopic>>();
  for (  DiscussionTopic dt : DiscussionTopics) {
    if (dt.getParentDiscussionTopicId() == 0) {
      List<DiscussionTopic> subDiscussionTopics=new ArrayList<>();
      DiscussionTopicsHierarchy.put(dt,subDiscussionTopics);
      DiscussionTopicsIndexer.put(dt.getDiscussionTopicId(),subDiscussionTopics);
    }
  }
  for (  DiscussionTopic dt : DiscussionTopics) {
    int parentDiscussionTopicId=dt.getParentDiscussionTopicId();
    if (parentDiscussionTopicId != 0) {
      List<DiscussionTopic> subDiscussionTopics=DiscussionTopicsIndexer.get(parentDiscussionTopicId);
      if (subDiscussionTopics != null) {
        subDiscussionTopics.add(dt);
      }
    }
  }
  return DiscussionTopicsHierarchy;
}

Fixed version (ground truth):
/** 
 * 获得具有层次关系的讨论话题列表.
 * @return 包含讨论话题及其继承关系的Map对象
 */
public Map<DiscussionTopic,List<DiscussionTopic>> getDiscussionTopicsWithHierarchy(){
  List<DiscussionTopic> DiscussionTopics=getDiscussionTopics();
  Map<Integer,List<DiscussionTopic>> DiscussionTopicsIndexer=new HashMap<>();
  Map<DiscussionTopic,List<DiscussionTopic>> DiscussionTopicsHierarchy=new LinkedHashMap<>();
  for (  DiscussionTopic dt : DiscussionTopics) {
    if (dt.getParentDiscussionTopicId() == 0) {
      List<DiscussionTopic> subDiscussionTopics=new ArrayList<>();
      DiscussionTopicsHierarchy.put(dt,subDiscussionTopics);
      DiscussionTopicsIndexer.put(dt.getDiscussionTopicId(),subDiscussionTopics);
    }
  }
  for (  DiscussionTopic dt : DiscussionTopics) {
    int parentDiscussionTopicId=dt.getParentDiscussionTopicId();
    if (parentDiscussionTopicId != 0) {
      List<DiscussionTopic> subDiscussionTopics=DiscussionTopicsIndexer.get(parentDiscussionTopicId);
      if (subDiscussionTopics != null) {
        subDiscussionTopics.add(dt);
      }
    }
  }
  return DiscussionTopicsHierarchy;
}
Program: 57682
Project: 57682
Buggy source:
/** 
 * 测试用例: 测试getDiscussionTopics()方法 测试数据: N/a 预期结果: 返回一个包含两个DiscussionTopic的列表
 */
@Test public void testGetDiscussionTopics(){
  List<DiscussionTopic> topics=discussionTopicMapper.getDiscussionTopics();
  Assert.assertEquals(2,topics.size());
  DiscussionTopic firstTopic=topics.get(0);
  Assert.assertEquals("String_Node_Str",firstTopic.getDiscussionTopicSlug());
}

Fixed version (ground truth):
/** 
 * 测试用例: 测试getDiscussionTopics()方法 测试数据: N/a 预期结果: 返回一个包含两个DiscussionTopic的列表
 */
@Test public void testGetDiscussionTopics(){
  List<DiscussionTopic> topics=discussionTopicMapper.getDiscussionTopics();
  Assert.assertEquals(4,topics.size());
  DiscussionTopic firstTopic=topics.get(0);
  Assert.assertEquals("String_Node_Str",firstTopic.getDiscussionTopicSlug());
}
Program: 57683
Project: 57683
Buggy source:
/** 
 * 更新网站常规选项.
 * @param websiteName - 网站名称
 * @param websiteDescription - 网站描述
 * @param copyright - 网站版权信息
 * @param allowUserRegister - 是否允许用户注册
 * @param icpNumber - 网站备案号
 * @param googleAnalyticsCode - Google Analytics代码
 * @param offensiveWords - 敏感词列表
 * @param request - HttpServletRequest对象
 * @return 网站常规选项的更新结果
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody Map<String,Boolean> updateGeneralSettingsAction(@RequestParam(value="String_Node_Str",required=true) String websiteName,@RequestParam(value="String_Node_Str",required=true) String websiteDescription,@RequestParam(value="String_Node_Str",required=true) String copyright,@RequestParam(value="String_Node_Str",required=true) boolean allowUserRegister,@RequestParam(value="String_Node_Str",required=true) String icpNumber,@RequestParam(value="String_Node_Str",required=true) String googleAnalyticsCode,@RequestParam(value="String_Node_Str",required=true) String offensiveWords,HttpServletRequest request){
  Map<String,Boolean> result=optionService.updateOptions(websiteName,websiteDescription,copyright,allowUserRegister,icpNumber,googleAnalyticsCode,offensiveWords);
  return result;
}

Fixed version (ground truth):
/** 
 * 更新网站常规选项.
 * @param websiteName - 网站名称
 * @param websiteDescription - 网站描述
 * @param copyright - 网站版权信息
 * @param allowUserRegister - 是否允许用户注册
 * @param icpNumber - 网站备案号
 * @param policeIcpNumber - 公安备案号
 * @param googleAnalyticsCode - Google Analytics代码
 * @param offensiveWords - 敏感词列表
 * @param request - HttpServletRequest对象
 * @return 网站常规选项的更新结果
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody Map<String,Boolean> updateGeneralSettingsAction(@RequestParam(value="String_Node_Str",required=true) String websiteName,@RequestParam(value="String_Node_Str",required=true) String websiteDescription,@RequestParam(value="String_Node_Str",required=true) String copyright,@RequestParam(value="String_Node_Str",required=true) boolean allowUserRegister,@RequestParam(value="String_Node_Str",required=true) String icpNumber,@RequestParam(value="String_Node_Str",required=true) String policeIcpNumber,@RequestParam(value="String_Node_Str",required=true) String googleAnalyticsCode,@RequestParam(value="String_Node_Str",required=true) String offensiveWords,HttpServletRequest request){
  Map<String,Boolean> result=optionService.updateOptions(websiteName,websiteDescription,copyright,allowUserRegister,icpNumber,policeIcpNumber,googleAnalyticsCode,offensiveWords);
  return result;
}
Program: 57684
Project: 57684
Buggy source:
/** 
 * 获取某个用户通过(Accpeted)提交记录的数量.
 * @param uid - 用户的唯一标识符
 * @return 某个用户通过(Accpeted)提交记录的数量
 */
public long getAcceptedSubmissionUsingUserId(@Param("String_Node_Str") long uid);

Fixed version (ground truth):
/** 
 * 获取某个用户通过(Accepted)提交记录的数量.
 * @param uid - 用户的唯一标识符
 * @return 某个用户通过(Accepted)提交记录的数量
 */
public long getAcceptedSubmissionUsingUserId(@Param("String_Node_Str") long uid);
Program: 57685
Project: 57685
Buggy source:
/** 
 * 根据试题分类的唯一英文缩写获取试题分类的唯一标识符.
 * @param problemCategorySlug - 试题分类的唯一英文缩写
 * @return 试题分类的唯一标识符
 */
private int getProblemCategoryIdUsingSlug(String problemCategorySlug){
  int problemCategoryId=0;
  if (!problemCategorySlug.isEmpty()) {
    ProblemCategory problemCategory=problemCategoryMapper.getProblemCategoryUsingCategorySlug(problemCategorySlug);
    if (problemCategory != null) {
      problemCategoryId=problemCategory.getParentProblemCategoryId();
    }
  }
  return problemCategoryId;
}

Fixed version (ground truth):
/** 
 * 根据试题分类的唯一英文缩写获取试题分类的唯一标识符.
 * @param problemCategorySlug - 试题分类的唯一英文缩写
 * @return 试题分类的唯一标识符
 */
private int getProblemCategoryIdUsingSlug(String problemCategorySlug){
  int problemCategoryId=0;
  if (!problemCategorySlug.isEmpty()) {
    ProblemCategory problemCategory=problemCategoryMapper.getProblemCategoryUsingCategorySlug(problemCategorySlug);
    if (problemCategory != null) {
      problemCategoryId=problemCategory.getProblemCategoryId();
    }
  }
  return problemCategoryId;
}
Program: 57686
Project: 57686
Buggy source:
/** 
 * 处理用户修改密码的请求.
 * @param user - 待修改密码的用户对象
 * @param oldPassword - 旧密码
 * @param newPassword - 新密码
 * @param confirmPassword - 确认新密码
 * @param request - HttpServletRequest对象
 * @return 一个包含密码验证结果的Map<String, Boolean>对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody Map<String,Boolean> changePasswordInDashboardAction(@RequestParam(value="String_Node_Str",required=true) String oldPassword,@RequestParam(value="String_Node_Str",required=true) String newPassword,@RequestParam(value="String_Node_Str",required=true) String confirmPassword,HttpServletRequest request){
  User currentUser=HttpSessionParser.getCurrentUser(request.getSession());
  String ipAddress=HttpRequestParser.getRemoteAddr(request);
  Map<String,Boolean> result=userService.changePassword(currentUser,oldPassword,newPassword,confirmPassword);
  if (result.get("String_Node_Str")) {
    LOGGER.info(String.format("String_Node_Str",new Object[]{currentUser,ipAddress}));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * 处理用户修改密码的请求.
 * @param oldPassword - 旧密码
 * @param newPassword - 新密码
 * @param confirmPassword - 确认新密码
 * @param request - HttpServletRequest对象
 * @return 一个包含密码验证结果的Map<String, Boolean>对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody Map<String,Boolean> changePasswordInDashboardAction(@RequestParam(value="String_Node_Str",required=true) String oldPassword,@RequestParam(value="String_Node_Str",required=true) String newPassword,@RequestParam(value="String_Node_Str",required=true) String confirmPassword,HttpServletRequest request){
  User currentUser=HttpSessionParser.getCurrentUser(request.getSession());
  String ipAddress=HttpRequestParser.getRemoteAddr(request);
  Map<String,Boolean> result=userService.changePassword(currentUser,oldPassword,newPassword,confirmPassword);
  if (result.get("String_Node_Str")) {
    LOGGER.info(String.format("String_Node_Str",new Object[]{currentUser,ipAddress}));
  }
  return result;
}
Program: 57687
Project: 57687
Buggy source:
/** 
 * 显示用户的登录页面.
 * @param isLogout - 是否处于登出状态
 * @param fowardUrl - 登录后跳转的地址(相对路径)
 * @param request - HttpServletRequest对象
 * @param response - HttpResponse对象
 * @return 包含登录页面信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView loginView(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") boolean isLogout,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") String forwardUrl,HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession();
  if (isLogout) {
    destroySession(request,session);
  }
  ModelAndView view=null;
  if (isLoggedIn(session)) {
    view=new ModelAndView("String_Node_Str");
  }
 else {
    view=new ModelAndView("String_Node_Str");
    view.addObject("String_Node_Str",isLogout);
    view.addObject("String_Node_Str",forwardUrl);
  }
  return view;
}

Fixed version (ground truth):
/** 
 * 显示用户的登录页面.
 * @param isLogout - 是否处于登出状态
 * @param forwardUrl - 登录后跳转的地址(相对路径)
 * @param request - HttpServletRequest对象
 * @param response - HttpResponse对象
 * @return 包含登录页面信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView loginView(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") boolean isLogout,@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") String forwardUrl,HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession();
  if (isLogout) {
    destroySession(request,session);
  }
  ModelAndView view=null;
  if (isLoggedIn(session)) {
    view=new ModelAndView("String_Node_Str");
  }
 else {
    view=new ModelAndView("String_Node_Str");
    view.addObject("String_Node_Str",isLogout);
    view.addObject("String_Node_Str",forwardUrl);
  }
  return view;
}
Program: 57688
Project: 57688
Buggy source:
/** 
 * 加载重置密码页面.
 * @param email - 用户的电子邮件地址
 * @param hashCode - 用于重置密码的随机字符串
 * @param request - HttpServletRequest对象
 * @param response - HttpResponse对象
 * @return 包含密码重置页面信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView resetPasswordView(@RequestParam(value="String_Node_Str",required=false) String email,@RequestParam(value="String_Node_Str",required=false) String token,HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession();
  ModelAndView view=null;
  if (isLoggedIn(session)) {
    view=new ModelAndView("String_Node_Str");
  }
 else {
    boolean isTokenValid=false;
    if (token != null && !token.isEmpty()) {
      isTokenValid=userService.isEmailValidationValid(email,token);
    }
    view=new ModelAndView("String_Node_Str");
    view.addObject("String_Node_Str",email);
    view.addObject("String_Node_Str",token);
    view.addObject("String_Node_Str",isTokenValid);
    view.addObject("String_Node_Str",CsrfProtector.getCsrfToken(session));
  }
  return view;
}

Fixed version (ground truth):
/** 
 * 加载重置密码页面.
 * @param email - 用户的电子邮件地址
 * @param token - 用于重置密码的随机字符串
 * @param request - HttpServletRequest对象
 * @param response - HttpResponse对象
 * @return 包含密码重置页面信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView resetPasswordView(@RequestParam(value="String_Node_Str",required=false) String email,@RequestParam(value="String_Node_Str",required=false) String token,HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession();
  ModelAndView view=null;
  if (isLoggedIn(session)) {
    view=new ModelAndView("String_Node_Str");
  }
 else {
    boolean isTokenValid=false;
    if (token != null && !token.isEmpty()) {
      isTokenValid=userService.isEmailValidationValid(email,token);
    }
    view=new ModelAndView("String_Node_Str");
    view.addObject("String_Node_Str",email);
    view.addObject("String_Node_Str",token);
    view.addObject("String_Node_Str",isTokenValid);
    view.addObject("String_Node_Str",CsrfProtector.getCsrfToken(session));
  }
  return view;
}
Program: 57689
Project: 57689
Buggy source:
/** 
 * 更新网站常规选项.
 * @param websiteName - 网站名称
 * @param websiteDescription - 网站描述
 * @param copyright - 网站版权信息
 * @param allowUserRegister - 是否允许用户注册
 * @param icpNumber - 网站备案号
 * @param googleAnalyticsCode - Google Analytics代码
 * @param sensitiveWords - 敏感词列表
 * @param request - HttpServletRequest对象
 * @return 网站常规选项的更新结果
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody Map<String,Boolean> updateGeneralSettingsAction(@RequestParam(value="String_Node_Str",required=true) String websiteName,@RequestParam(value="String_Node_Str",required=true) String websiteDescription,@RequestParam(value="String_Node_Str",required=true) String copyright,@RequestParam(value="String_Node_Str",required=true) boolean allowUserRegister,@RequestParam(value="String_Node_Str",required=true) String icpNumber,@RequestParam(value="String_Node_Str",required=true) String googleAnalyticsCode,@RequestParam(value="String_Node_Str",required=true) String offensiveWords,HttpServletRequest request){
  Map<String,Boolean> result=optionService.updateOptions(websiteName,websiteDescription,copyright,allowUserRegister,icpNumber,googleAnalyticsCode,offensiveWords);
  return result;
}

Fixed version (ground truth):
/** 
 * 更新网站常规选项.
 * @param websiteName - 网站名称
 * @param websiteDescription - 网站描述
 * @param copyright - 网站版权信息
 * @param allowUserRegister - 是否允许用户注册
 * @param icpNumber - 网站备案号
 * @param googleAnalyticsCode - Google Analytics代码
 * @param offensiveWords - 敏感词列表
 * @param request - HttpServletRequest对象
 * @return 网站常规选项的更新结果
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody Map<String,Boolean> updateGeneralSettingsAction(@RequestParam(value="String_Node_Str",required=true) String websiteName,@RequestParam(value="String_Node_Str",required=true) String websiteDescription,@RequestParam(value="String_Node_Str",required=true) String copyright,@RequestParam(value="String_Node_Str",required=true) boolean allowUserRegister,@RequestParam(value="String_Node_Str",required=true) String icpNumber,@RequestParam(value="String_Node_Str",required=true) String googleAnalyticsCode,@RequestParam(value="String_Node_Str",required=true) String offensiveWords,HttpServletRequest request){
  Map<String,Boolean> result=optionService.updateOptions(websiteName,websiteDescription,copyright,allowUserRegister,icpNumber,googleAnalyticsCode,offensiveWords);
  return result;
}
Program: 57690
Project: 57690
Buggy source:
/** 
 * 删除选定的提交记录.
 * @param submissions - 提交记录ID的集合, 以逗号(, )分隔
 * @param request - HttpServletRequest对象
 * @return 提交记录的删除结果
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody Map<String,Boolean> deleteUsersAction(@RequestParam(value="String_Node_Str",required=true) String users,HttpServletRequest request){
  Map<String,Boolean> result=new HashMap<String,Boolean>(2,1);
  List<Long> userList=JSON.parseArray(users,Long.class);
  for (  Long userId : userList) {
    userService.deleteUser(userId);
  }
  result.put("String_Node_Str",true);
  return result;
}

Fixed version (ground truth):
/** 
 * 删除选定的用户.
 * @param users - 用户ID的集合, 以逗号(, )分隔
 * @param request - HttpServletRequest对象
 * @return 提交记录的删除结果
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody Map<String,Boolean> deleteUsersAction(@RequestParam(value="String_Node_Str",required=true) String users,HttpServletRequest request){
  Map<String,Boolean> result=new HashMap<String,Boolean>(2,1);
  List<Long> userList=JSON.parseArray(users,Long.class);
  for (  Long userId : userList) {
    userService.deleteUser(userId);
  }
  result.put("String_Node_Str",true);
  return result;
}
Program: 57692
Project: 57692
Buggy source:
/** 
 * 通过试题的唯一标识符获取试题标签对象的列表.
 * @param problemTagId - 试题的唯一标识符
 * @return 预期的试题标签对象列表
 */
public List<ProblemTag> getProblemTagUsingProblemId(long problemId);

Fixed version (ground truth):
/** 
 * 通过试题的唯一标识符获取试题标签对象的列表.
 * @param problemId - 试题的唯一标识符
 * @return 预期的试题标签对象列表
 */
public List<ProblemTag> getProblemTagUsingProblemId(long problemId);
Program: 57693
Project: 57693
Buggy source:
/** 
 * 通过评测记录唯一标识符获取试题对象.
 * @param submissionID - 评测记录的唯一标识符
 * @return 一个评测记录对象
 */
public Submission getSubmission(@Param("String_Node_Str") long submissionId);

Fixed version (ground truth):
/** 
 * 通过评测记录唯一标识符获取试题对象.
 * @param submissionId - 评测记录的唯一标识符
 * @return 一个评测记录对象
 */
public Submission getSubmission(@Param("String_Node_Str") long submissionId);
Program: 57694
Project: 57694
Buggy source:
/** 
 * 通过电子邮件地址获取用户对象.
 * @param username - 用户名
 * @return 预期的用户对象或空引用
 */
public User getUserUsingEmail(@Param("String_Node_Str") String email);

Fixed version (ground truth):
/** 
 * 通过电子邮件地址获取用户对象.
 * @param email - 电子邮件地址
 * @return 预期的用户对象或空引用
 */
public User getUserUsingEmail(@Param("String_Node_Str") String email);
Program: 57696
Project: 57696
Buggy source:
/** 
 * 创建评测任务, 将提交的信息提交至消息队列.
 * @param submission - 提交记录对象
 */
public void createSubmissionTask(long submissionId){
  Map<String,Object> mapMessage=new HashMap<String,Object>();
  mapMessage.put("String_Node_Str","String_Node_Str");
  mapMessage.put("String_Node_Str",submissionId);
  messageSender.sendMessage(mapMessage);
}

Fixed version (ground truth):
/** 
 * 创建评测任务, 将提交的信息提交至消息队列.
 * @param submissionId - 提交记录的唯一标识符
 */
public void createSubmissionTask(long submissionId){
  Map<String,Object> mapMessage=new HashMap<String,Object>();
  mapMessage.put("String_Node_Str","String_Node_Str");
  mapMessage.put("String_Node_Str",submissionId);
  messageSender.sendMessage(mapMessage);
}
Program: 57697
Project: 57697
Buggy source:
/** 
 * 过滤包含HTML字符串.
 * @param str - 待过滤的字符串
 * @return 过滤后的字符串.
 */
public static String filter(String text){
  if (text == null) {
    return text;
  }
  Document document=Jsoup.parse(text);
  document.outputSettings(new Document.OutputSettings().prettyPrint(false));
  document.select("String_Node_Str").append("String_Node_Str");
  document.select("String_Node_Str").prepend("String_Node_Str");
  String s=document.html().replaceAll("String_Node_Str","String_Node_Str");
  return Jsoup.clean(s,"String_Node_Str",Whitelist.none(),new Document.OutputSettings().prettyPrint(false));
}

Fixed version (ground truth):
/** 
 * 过滤包含HTML字符串.
 * @param text - 待过滤的字符串
 * @return 过滤后的字符串.
 */
public static String filter(String text){
  if (text == null) {
    return text;
  }
  Document document=Jsoup.parse(text);
  document.outputSettings(new Document.OutputSettings().prettyPrint(false));
  document.select("String_Node_Str").append("String_Node_Str");
  document.select("String_Node_Str").prepend("String_Node_Str");
  String s=document.html().replaceAll("String_Node_Str","String_Node_Str");
  return Jsoup.clean(s,"String_Node_Str",Whitelist.none(),new Document.OutputSettings().prettyPrint(false));
}
Program: 57698
Project: 57698
Buggy source:
/** 
 * 提供敏感词过滤的功能.
 * @param txt 带过滤字符串
 * @param matchType 匹配规则, 1 为极小匹配, 2 为极大匹配
 * @return 过滤后的字符串
 */
private String filter(String text,int matchType,String replaceChar){
  List<Position> offensiveWordsPosition=getOffensiveWordsPosition(text,matchType);
  StringBuilder resultStringBuilder=new StringBuilder(text);
  Iterator<Position> iterator=offensiveWordsPosition.iterator();
  while (iterator.hasNext()) {
    Position now=iterator.next();
    resultStringBuilder.replace(now.start,now.start + now.length,getReplaceChars(replaceChar,now.length));
  }
  return resultStringBuilder.toString();
}

Fixed version (ground truth):
/** 
 * 提供敏感词过滤的功能.
 * @param text - 待过滤字符串
 * @param matchType - 匹配规则, 1 为极小匹配, 2 为极大匹配
 * @return 过滤后的字符串
 */
private String filter(String text,int matchType,String replaceChar){
  List<Position> offensiveWordsPosition=getOffensiveWordsPosition(text,matchType);
  StringBuilder resultStringBuilder=new StringBuilder(text);
  Iterator<Position> iterator=offensiveWordsPosition.iterator();
  while (iterator.hasNext()) {
    Position now=iterator.next();
    resultStringBuilder.replace(now.start,now.start + now.length,getReplaceChars(replaceChar,now.length));
  }
  return resultStringBuilder.toString();
}
Program: 57699
Project: 57699
Buggy source:
/** 
 * 获取敏感词的位置.
 * @param text - 待过滤字符串
 * @param matchType - 匹配规则 1 为极小匹配,  2 为极大匹配
 * @return 敏感词的位置
 */
private List<Position> getOffensiveWordsPosition(String txt,int matchType){
  List<Position> offensiveWordsPosition=new ArrayList<Position>();
  for (int i=0; i < txt.length(); ++i) {
    int length=checkOffensiveWord(txt,i,matchType);
    if (length > 0) {
      Position position=new Position(i,length);
      offensiveWordsPosition.add(position);
      i=i + length - 1;
    }
  }
  return offensiveWordsPosition;
}

Fixed version (ground truth):
/** 
 * 获取敏感词的位置.
 * @param text - 待过滤字符串
 * @param matchType - 匹配规则 1 为极小匹配,  2 为极大匹配
 * @return 敏感词的位置
 */
private List<Position> getOffensiveWordsPosition(String text,int matchType){
  List<Position> offensiveWordsPosition=new ArrayList<Position>();
  for (int i=0; i < text.length(); ++i) {
    int length=checkOffensiveWord(text,i,matchType);
    if (length > 0) {
      Position position=new Position(i,length);
      offensiveWordsPosition.add(position);
      i=i + length - 1;
    }
  }
  return offensiveWordsPosition;
}
Program: 57700
Project: 57700
Buggy source:
/** 
 * 获取实时的评测结果.
 * @param submissionId - 提交记录的唯一标识符
 * @return 包含评测结果信息的StreamingResponseBody对象
 * @throws IOException 
 */
@RequestMapping("String_Node_Str") public SseEmitter getRealTimeJudgeResultAction(@RequestParam(value="String_Node_Str",required=true) long submissionId,@RequestParam(value="String_Node_Str",required=true) String csrfToken,HttpServletRequest request) throws IOException {
  User currentUser=HttpSessionParser.getCurrentUser(request.getSession());
  boolean isCsrfTokenValid=CsrfProtector.isCsrfTokenValid(csrfToken,request.getSession());
  Submission submission=submissionService.getSubmission(submissionId);
  if (!isCsrfTokenValid || submission == null || !submission.getUser().equals(currentUser) || !submission.getJudgeResult().getJudgeResultSlug().equals("String_Node_Str")) {
    throw new ResourceNotFoundException();
  }
  SseEmitter sseEmitter=new SseEmitter();
  submissionEventListener.addSseEmitters(submissionId,sseEmitter);
  sseEmitter.send("String_Node_Str");
  return sseEmitter;
}

Fixed version (ground truth):
/** 
 * 获取实时的评测结果.
 * @param submissionId - 提交记录的唯一标识符
 * @return 包含评测结果信息的StreamingResponseBody对象
 * @throws IOException 
 */
@RequestMapping("String_Node_Str") public SseEmitter getRealTimeJudgeResultAction(@RequestParam(value="String_Node_Str",required=true) long submissionId,@RequestParam(value="String_Node_Str",required=true) String csrfToken,HttpServletRequest request,HttpServletResponse response) throws IOException {
  User currentUser=HttpSessionParser.getCurrentUser(request.getSession());
  boolean isCsrfTokenValid=CsrfProtector.isCsrfTokenValid(csrfToken,request.getSession());
  Submission submission=submissionService.getSubmission(submissionId);
  if (!isCsrfTokenValid || submission == null || !submission.getUser().equals(currentUser) || !submission.getJudgeResult().getJudgeResultSlug().equals("String_Node_Str")) {
    throw new ResourceNotFoundException();
  }
  response.addHeader("String_Node_Str","String_Node_Str");
  SseEmitter sseEmitter=new SseEmitter();
  submissionEventListener.addSseEmitters(submissionId,sseEmitter);
  sseEmitter.send("String_Node_Str");
  return sseEmitter;
}
Program: 57701
Project: 57701
Buggy source:
/** 
 * 收到消息队列的新的评测请求时的回调函数.
 * @param submissionId - 评测记录的唯一标识符
 */
public void onSubmissionCreated(long submissionId){
  try {
    judgerDispatcher.createNewTask(submissionId);
  }
 catch (  IllgealSubmissionException ex) {
    logger.catching(ex);
  }
}

Fixed version (ground truth):
/** 
 * 收到消息队列的新的评测请求时的回调函数.
 * @param submissionId - 评测记录的唯一标识符
 */
public void onSubmissionCreated(long submissionId){
  System.out.println(1);
  try {
    judgerDispatcher.createNewTask(submissionId);
  }
 catch (  IllgealSubmissionException ex) {
    logger.catching(ex);
  }
}
Program: 57702
Project: 57702
Buggy source:
/** 
 * 获取当前用户的显示语言.
 * @param request - HttpRequest对象
 * @param session - HttpSession对象
 * @return 当前用户显示语言的唯一英文缩写
 */
private String getUserLanguage(HttpServletRequest request,HttpSession session){
  Object languageAttribute=session.getAttribute("String_Node_Str");
  if (languageAttribute == null) {
    String preferNaturalLanguage=getPreferNaturalLanguage(request);
    session.setAttribute("String_Node_Str",preferNaturalLanguage);
    return preferNaturalLanguage;
  }
  return (String)languageAttribute;
}

Fixed version (ground truth):
/** 
 * 获取当前用户的显示语言.
 * @param request - HttpRequest对象
 * @param response - HttpResponse对象
 * @return 当前用户显示语言的唯一英文缩写
 */
private String getUserLanguage(HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession();
  Object languageAttribute=session.getAttribute("String_Node_Str");
  if (languageAttribute == null) {
    String preferNaturalLanguage=getPreferNaturalLanguage(request,response);
    LocaleUtils.setLocale(request,response,preferNaturalLanguage);
    return preferNaturalLanguage;
  }
  return (String)languageAttribute;
}
Program: 57703
Project: 57703
Buggy source:
/** 
 * 加载已登录用户的个人信息及答题情况.
 * @param proceedingJoinPoint - ProceedingJoinPoint对象
 * @param request - HttpRequest对象
 * @return 一个包含预期视图的ModelAndView对象
 * @throws Throwable - ResourceNotFound异常
 */
@Around(value="String_Node_Str") public ModelAndView getUserProfile(ProceedingJoinPoint proceedingJoinPoint,HttpServletRequest request) throws Throwable {
  ModelAndView view=null;
  HttpSession session=request.getSession();
  view=(ModelAndView)proceedingJoinPoint.proceed();
  view.addObject("String_Node_Str",getUserLanguage(request,session));
  boolean isLoggedIn=isLoggedIn(session);
  if (isLoggedIn) {
    long uid=(Long)session.getAttribute("String_Node_Str");
    User user=userService.getUserUsingUid(uid);
    view.addObject("String_Node_Str",isLoggedIn).addObject("String_Node_Str",user).addObject("String_Node_Str",submissionService.getUserSubmissionStats(user.getUid()));
  }
  return view;
}

Fixed version (ground truth):
/** 
 * 加载已登录用户的个人信息及答题情况.
 * @param proceedingJoinPoint - ProceedingJoinPoint对象
 * @param request - HttpRequest对象
 * @param response - HttpResponse对象
 * @return 一个包含预期视图的ModelAndView对象
 * @throws Throwable - ResourceNotFound异常
 */
@Around(value="String_Node_Str") public ModelAndView getUserProfile(ProceedingJoinPoint proceedingJoinPoint,HttpServletRequest request,HttpServletResponse response) throws Throwable {
  ModelAndView view=null;
  HttpSession session=request.getSession();
  view=(ModelAndView)proceedingJoinPoint.proceed();
  view.addObject("String_Node_Str",getUserLanguage(request,response));
  boolean isLoggedIn=isLoggedIn(session);
  if (isLoggedIn) {
    long uid=(Long)session.getAttribute("String_Node_Str");
    User user=userService.getUserUsingUid(uid);
    view.addObject("String_Node_Str",isLoggedIn).addObject("String_Node_Str",user).addObject("String_Node_Str",submissionService.getUserSubmissionStats(user.getUid()));
  }
  return view;
}
Program: 57704
Project: 57704
Buggy source:
/** 
 * 根据用户浏览器语言和系统支持的语言推荐默认语言.
 * @param request - HttpRequest对象
 * @return 推荐语言的代码(例如zh_CN)
 */
private String getPreferNaturalLanguage(HttpServletRequest request){
  final String DEFAULT_LANGUAGE="String_Node_Str";
  final String[] supportedLanguages={"String_Node_Str","String_Node_Str"};
  Locale browserLocale=getBrowserLocale(request);
  for (  String supportedLanguage : supportedLanguages) {
    Locale supportLanguageLocale=getLocaleOfSupportedLanguage(supportedLanguage);
    if (supportLanguageLocale.getLanguage().equals(browserLocale.getLanguage())) {
      return supportedLanguage;
    }
  }
  return DEFAULT_LANGUAGE;
}

Fixed version (ground truth):
/** 
 * 根据用户浏览器语言和系统支持的语言推荐默认语言.
 * @param request - HttpRequest对象
 * @param response - HttpResponse对象
 * @return 推荐语言的代码(例如zh_CN)
 */
private String getPreferNaturalLanguage(HttpServletRequest request,HttpServletResponse response){
  final String DEFAULT_LANGUAGE="String_Node_Str";
  final String[] supportedLanguages={"String_Node_Str","String_Node_Str"};
  Locale browserLocale=getBrowserLocale(request);
  for (  String supportedLanguage : supportedLanguages) {
    Locale supportLanguageLocale=LocaleUtils.getLocaleOfLanguage(supportedLanguage);
    if (supportLanguageLocale.getLanguage().equals(browserLocale.getLanguage())) {
      return supportedLanguage;
    }
  }
  return DEFAULT_LANGUAGE;
}
Program: 57705
Project: 57705
Buggy source:
/** 
 * 显示用户的登录页面.
 * @param isLogout - 是否处于登出状态
 * @param request - Http Servlet Request对象
 * @return 包含登录页面信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str") public ModelAndView loginView(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") boolean isLogout,HttpServletRequest request){
  HttpSession session=request.getSession();
  if (isLogout) {
    destroySession(request,session);
  }
  ModelAndView view=null;
  if (isLoggedIn(session)) {
    view=new ModelAndView("String_Node_Str");
  }
 else {
    view=new ModelAndView("String_Node_Str");
    view.addObject("String_Node_Str",isLogout);
  }
  return view;
}

Fixed version (ground truth):
/** 
 * 显示用户的登录页面.
 * @param isLogout - 是否处于登出状态
 * @param request - Http Servlet Request对象
 * @param response - HttpResponse对象
 * @return 包含登录页面信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str") public ModelAndView loginView(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") boolean isLogout,HttpServletRequest request,HttpServletResponse response){
  HttpSession session=request.getSession();
  if (isLogout) {
    destroySession(request,session);
  }
  ModelAndView view=null;
  if (isLoggedIn(session)) {
    view=new ModelAndView("String_Node_Str");
  }
 else {
    view=new ModelAndView("String_Node_Str");
    view.addObject("String_Node_Str",isLogout);
  }
  return view;
}
Program: 57706
Project: 57706
Buggy source:
/** 
 * 显示升级浏览器页面.
 * @param request - HttpRequest对象
 * @return 一个包含升级浏览器页面内容的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView notSupportedView(HttpServletRequest request){
  ModelAndView view=new ModelAndView("String_Node_Str");
  return view;
}

Fixed version (ground truth):
/** 
 * 显示升级浏览器页面.
 * @param request - HttpRequest对象
 * @param response - HttpResponse对象
 * @return 一个包含升级浏览器页面内容的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView notSupportedView(HttpServletRequest request,HttpServletResponse response){
  ModelAndView view=new ModelAndView("String_Node_Str");
  return view;
}
Program: 57707
Project: 57707
Buggy source:
/** 
 * 显示应用程序的首页.
 * @param request - HttpRequest对象
 * @return 一个包含首页内容的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView indexView(HttpServletRequest request){
  ModelAndView view=new ModelAndView("String_Node_Str");
  return view;
}

Fixed version (ground truth):
/** 
 * 显示应用程序的首页.
 * @param request - HttpRequest对象
 * @param response - HttpResponse对象
 * @return 一个包含首页内容的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView indexView(HttpServletRequest request,HttpServletResponse response){
  ModelAndView view=new ModelAndView("String_Node_Str");
  return view;
}
Program: 57708
Project: 57708
Buggy source:
/** 
 * 处理通用Exception异常的方法.
 * @param request - HttpRequest对象
 * @return 返回一个包含异常信息的ModelAndView对象
 */
@ResponseStatus(value=HttpStatus.INTERNAL_SERVER_ERROR) @ExceptionHandler(Exception.class) public ModelAndView InternelServerErrorView(HttpServletRequest request,Exception ex){
  logger.catching(ex);
  ModelAndView view=new ModelAndView("String_Node_Str");
  return view;
}

Fixed version (ground truth):
/** 
 * 处理通用Exception异常的方法.
 * @param ex - 抛出的异常对象
 * @param request - HttpRequest对象
 * @param response - HttpResponse对象
 * @return 返回一个包含异常信息的ModelAndView对象
 */
@ResponseStatus(value=HttpStatus.INTERNAL_SERVER_ERROR) @ExceptionHandler(Exception.class) public ModelAndView InternelServerErrorView(Exception ex,HttpServletRequest request,HttpServletResponse response){
  logger.catching(ex);
  ModelAndView view=new ModelAndView("String_Node_Str");
  return view;
}
Program: 57709
Project: 57709
Buggy source:
/** 
 * 处理ResourceNotFoundException异常的方法.
 * @param request - HttpRequest对象
 * @return 返回一个包含异常信息的ModelAndView对象
 */
@ResponseStatus(value=HttpStatus.NOT_FOUND) @ExceptionHandler(ResourceNotFoundException.class) public ModelAndView ResourceNotFoundView(HttpServletRequest request){
  ModelAndView view=new ModelAndView("String_Node_Str");
  return view;
}

Fixed version (ground truth):
/** 
 * 处理ResourceNotFoundException异常的方法.
 * @param request - HttpRequest对象
 * @param response - HttpResponse对象
 * @return 返回一个包含异常信息的ModelAndView对象
 */
@ResponseStatus(value=HttpStatus.NOT_FOUND) @ExceptionHandler(ResourceNotFoundException.class) public ModelAndView ResourceNotFoundView(HttpServletRequest request,HttpServletResponse response){
  ModelAndView view=new ModelAndView("String_Node_Str");
  return view;
}
Program: 57710
Project: 57710
Buggy source:
/** 
 * 加载试题的详细信息.
 * @param problemID - 试题的唯一标识符
 * @param request - Http Servlet Request对象
 * @param session - Http Session对象
 * @return 包含试题详细信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str") public ModelAndView problemView(@PathVariable("String_Node_Str") int problemId,HttpServletRequest request){
  Problem problem=problemService.getProblem(problemId);
  if (problem == null || !problem.isPublic()) {
    throw new ResourceNotFoundException();
  }
  ModelAndView view=new ModelAndView("String_Node_Str");
  view.addObject("String_Node_Str",problem);
  HttpSession session=request.getSession();
  if (isLoggedIn(session)) {
    long userId=(Long)session.getAttribute("String_Node_Str");
    Map<Long,Submission> submissionOfProblems=submissionService.getSubmissionOfProblems(userId,problemId,problemId + 1);
    List<Submission> submissions=submissionService.getSubmissionUsingProblemIdAndUserId(problemId,userId,NUMBER_OF_SUBMISSIONS_PER_PROBLEM);
    view.addObject("String_Node_Str",submissionOfProblems);
    view.addObject("String_Node_Str",submissions);
  }
  return view;
}

Fixed version (ground truth):
/** 
 * 加载试题的详细信息.
 * @param problemID - 试题的唯一标识符
 * @param request - Http Servlet Request对象
 * @param response - HttpResponse对象
 * @return 包含试题详细信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str") public ModelAndView problemView(@PathVariable("String_Node_Str") int problemId,HttpServletRequest request,HttpServletResponse response){
  Problem problem=problemService.getProblem(problemId);
  if (problem == null || !problem.isPublic()) {
    throw new ResourceNotFoundException();
  }
  ModelAndView view=new ModelAndView("String_Node_Str");
  view.addObject("String_Node_Str",problem);
  HttpSession session=request.getSession();
  if (isLoggedIn(session)) {
    long userId=(Long)session.getAttribute("String_Node_Str");
    Map<Long,Submission> submissionOfProblems=submissionService.getSubmissionOfProblems(userId,problemId,problemId + 1);
    List<Submission> submissions=submissionService.getSubmissionUsingProblemIdAndUserId(problemId,userId,NUMBER_OF_SUBMISSIONS_PER_PROBLEM);
    view.addObject("String_Node_Str",submissionOfProblems);
    view.addObject("String_Node_Str",submissions);
  }
  return view;
}
Program: 57711
Project: 57711
Buggy source:
/** 
 * 显示试题库中的全部试题.
 * @param startIndex - 试题的起始下标
 * @param request - Http Servlet Request对象
 * @param session - Http Session对象
 * @return 包含试题库页面信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str") public ModelAndView problemsView(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") int startIndex,HttpServletRequest request){
  if (startIndex < START_INDEX_OF_PROBLEMS) {
    startIndex=START_INDEX_OF_PROBLEMS;
  }
  ModelAndView view=new ModelAndView("String_Node_Str");
  view.addObject("String_Node_Str",problemService.getProblems(startIndex,NUMBER_OF_PROBLEMS_PER_PAGE)).addObject("String_Node_Str",START_INDEX_OF_PROBLEMS).addObject("String_Node_Str",NUMBER_OF_PROBLEMS_PER_PAGE).addObject("String_Node_Str",problemService.getNumberOfProblems());
  HttpSession session=request.getSession();
  if (isLoggedIn(session)) {
    long userId=(Long)session.getAttribute("String_Node_Str");
    Map<Long,Submission> submissionOfProblems=submissionService.getSubmissionOfProblems(userId,startIndex,startIndex + NUMBER_OF_PROBLEMS_PER_PAGE);
    view.addObject("String_Node_Str",submissionOfProblems);
  }
  return view;
}

Fixed version (ground truth):
/** 
 * 显示试题库中的全部试题.
 * @param startIndex - 试题的起始下标
 * @param request - Http Servlet Request对象
 * @param response - HttpResponse对象
 * @return 包含试题库页面信息的ModelAndView对象
 */
@RequestMapping(value="String_Node_Str") public ModelAndView problemsView(@RequestParam(value="String_Node_Str",required=false,defaultValue="String_Node_Str") int startIndex,HttpServletRequest request,HttpServletResponse response){
  if (startIndex < START_INDEX_OF_PROBLEMS) {
    startIndex=START_INDEX_OF_PROBLEMS;
  }
  ModelAndView view=new ModelAndView("String_Node_Str");
  view.addObject("String_Node_Str",problemService.getProblems(startIndex,NUMBER_OF_PROBLEMS_PER_PAGE)).addObject("String_Node_Str",START_INDEX_OF_PROBLEMS).addObject("String_Node_Str",NUMBER_OF_PROBLEMS_PER_PAGE).addObject("String_Node_Str",problemService.getNumberOfProblems());
  HttpSession session=request.getSession();
  if (isLoggedIn(session)) {
    long userId=(Long)session.getAttribute("String_Node_Str");
    Map<Long,Submission> submissionOfProblems=submissionService.getSubmissionOfProblems(userId,startIndex,startIndex + NUMBER_OF_PROBLEMS_PER_PAGE);
    view.addObject("String_Node_Str",submissionOfProblems);
  }
  return view;
}
Program: 57712
Project: 57712
Buggy source:
/** 
 * 显示提交列表的页面.
 * @param request - HttpRequest对象
 * @return 包含提交列表的ModelAndView对象 
 */
@RequestMapping(value="String_Node_Str") public ModelAndView submissionsView(HttpServletRequest request){
  List<Submission> submissions=submissionService.getSubmissions(NUMBER_OF_SUBMISSION_PER_PAGE);
  return new ModelAndView("String_Node_Str").addObject("String_Node_Str",submissions);
}

Fixed version (ground truth):
/** 
 * 显示提交列表的页面.
 * @param request - HttpRequest对象
 * @param response - HttpResponse对象
 * @return 包含提交列表的ModelAndView对象 
 */
@RequestMapping(value="String_Node_Str") public ModelAndView submissionsView(HttpServletRequest request,HttpServletResponse response){
  List<Submission> submissions=submissionService.getSubmissions(NUMBER_OF_SUBMISSION_PER_PAGE);
  return new ModelAndView("String_Node_Str").addObject("String_Node_Str",submissions);
}
Program: 57713
Project: 57713
Buggy source:
/** 
 * 显示提交详细信息的页面.
 * @param submissionId - 提交的唯一标识符
 * @param request - HttpRequest对象
 * @return 包含提交详细信息的ModelAndView对象 
 */
@RequestMapping(value="String_Node_Str") public ModelAndView submissionView(@PathVariable("String_Node_Str") int submissionId,HttpServletRequest request){
  Submission submission=submissionService.getSubmission(submissionId);
  if (submission == null) {
    throw new ResourceNotFoundException();
  }
  ModelAndView view=new ModelAndView("String_Node_Str");
  view.addObject("String_Node_Str",submission);
  return view;
}

Fixed version (ground truth):
/** 
 * 显示提交详细信息的页面.
 * @param submissionId - 提交的唯一标识符
 * @param request - HttpRequest对象
 * @param response - HttpResponse对象
 * @return 包含提交详细信息的ModelAndView对象 
 */
@RequestMapping(value="String_Node_Str") public ModelAndView submissionView(@PathVariable("String_Node_Str") int submissionId,HttpServletRequest request,HttpServletResponse response){
  Submission submission=submissionService.getSubmission(submissionId);
  if (submission == null) {
    throw new ResourceNotFoundException();
  }
  ModelAndView view=new ModelAndView("String_Node_Str");
  view.addObject("String_Node_Str",submission);
  return view;
}
Program: 57714
Project: 57714
Buggy source:
/** 
 * 测试用例: 测试getProblems(long, int)方法 测试数据: 获取ID从1000起始的10道试题 预期结果: 返回预期的试题列表(共2题)
 */
@Test public void testGetProblemsFrom1000WithLimit10(){
  List<Problem> problems=problemMapper.getProblems(1000,10);
  Assert.assertEquals(2,problems.size());
  Problem firstProblem=problems.get(0);
  long problemId=firstProblem.getProblemID();
  Assert.assertEquals(1000,problemId);
  String problemName=firstProblem.getProblemName();
  Assert.assertEquals("String_Node_Str",problemName);
  long acceptedSubmission=firstProblem.getAcceptedSubmission();
  Assert.assertEquals(2,acceptedSubmission);
}

Fixed version (ground truth):
/** 
 * 测试用例: 测试getProblems(long, int)方法 测试数据: 获取ID从1000起始的10道试题 预期结果: 返回预期的试题列表(共2题)
 */
@Test public void testGetProblemsFrom1000WithLimit10(){
  List<Problem> problems=problemMapper.getProblems(1000,10);
  Assert.assertEquals(2,problems.size());
  Problem firstProblem=problems.get(0);
  long problemId=firstProblem.getProblemId();
  Assert.assertEquals(1000,problemId);
  String problemName=firstProblem.getProblemName();
  Assert.assertEquals("String_Node_Str",problemName);
  long acceptedSubmission=firstProblem.getAcceptedSubmission();
  Assert.assertEquals(2,acceptedSubmission);
}
Program: 57715
Project: 57715
Buggy source:
/** 
 * 测试用例: 测试getProblems(long, int)方法 测试数据: 获取ID从1001起始的1道试题 预期结果: 返回预期的试题列表(共1题)
 */
@Test public void testGetProblemsFrom1001WithLimit1(){
  List<Problem> problems=problemMapper.getProblems(1001,1);
  Assert.assertEquals(1,problems.size());
  Problem firstProblem=problems.get(0);
  long problemId=firstProblem.getProblemID();
  Assert.assertEquals(1001,problemId);
  long acceptedSubmission=firstProblem.getAcceptedSubmission();
  Assert.assertEquals(1,acceptedSubmission);
}

Fixed version (ground truth):
/** 
 * 测试用例: 测试getProblems(long, int)方法 测试数据: 获取ID从1001起始的1道试题 预期结果: 返回预期的试题列表(共1题)
 */
@Test public void testGetProblemsFrom1001WithLimit1(){
  List<Problem> problems=problemMapper.getProblems(1001,1);
  Assert.assertEquals(1,problems.size());
  Problem firstProblem=problems.get(0);
  long problemId=firstProblem.getProblemId();
  Assert.assertEquals(1001,problemId);
  long acceptedSubmission=firstProblem.getAcceptedSubmission();
  Assert.assertEquals(1,acceptedSubmission);
}
Program: 57716
Project: 57716
Buggy source:
/** 
 * 测试用例: 测试getProblems(long, int)方法 测试数据: 获取ID从1000起始的10道试题 预期结果: 返回预期的试题列表(共2题)
 */
@Test public void testGetProblemsFrom1000WithLimit10(){
  List<Problem> problems=problemMapper.getProblems(1000,10);
  Assert.assertEquals(2,problems.size());
  Problem firstProblem=problems.get(0);
  long problemId=firstProblem.getProblemId();
  Assert.assertEquals(1000,problemId);
  String problemName=firstProblem.getProblemName();
  Assert.assertEquals("String_Node_Str",problemName);
  long acceptedSubmission=firstProblem.getAcceptedSubmission();
  Assert.assertEquals(2,acceptedSubmission);
}

Fixed version (ground truth):
/** 
 * 测试用例: 测试getProblems(long, int)方法 测试数据: 获取ID从1000起始的10道试题 预期结果: 返回预期的试题列表(共2题)
 */
@Test public void testGetProblemsFrom1000WithLimit10(){
  List<Problem> problems=problemMapper.getProblems(1000,10);
  Assert.assertEquals(2,problems.size());
  Problem firstProblem=problems.get(0);
  long problemId=firstProblem.getProblemId();
  Assert.assertEquals(1000,problemId);
  String problemName=firstProblem.getProblemName();
  Assert.assertEquals("String_Node_Str",problemName);
  long acceptedSubmission=firstProblem.getAcceptedSubmission();
  Assert.assertEquals(1,acceptedSubmission);
}
Program: 57717
Project: 57717
Buggy source:
/** 
 * 测试用例: 测试getProblem()方法 测试数据: 使用A+B Problem的试题唯一标识符 预期结果: 返回预期的试题对象
 */
@Test public void testGetProblemExists(){
  Problem problem=problemMapper.getProblem(1000);
  Assert.assertNotNull(problem);
  String problemName=problem.getProblemName();
  Assert.assertEquals("String_Node_Str",problemName);
  long acceptedSubmission=problem.getAcceptedSubmission();
  Assert.assertEquals(2,acceptedSubmission);
}

Fixed version (ground truth):
/** 
 * 测试用例: 测试getProblem()方法 测试数据: 使用A+B Problem的试题唯一标识符 预期结果: 返回预期的试题对象
 */
@Test public void testGetProblemExists(){
  Problem problem=problemMapper.getProblem(1000);
  Assert.assertNotNull(problem);
  String problemName=problem.getProblemName();
  Assert.assertEquals("String_Node_Str",problemName);
  long acceptedSubmission=problem.getAcceptedSubmission();
  Assert.assertEquals(1,acceptedSubmission);
}
Program: 57718
Project: 57718
Buggy source:
/** 
 * 测试用例: 测试deleteLanguage(int)方法 测试数据: 不存在的编程语言唯一标识符 预期结果: 方法正常执行, 未影响数据表中的数据
 */
@Test public void testDeleteLanguageNotExists(){
  Language language=languageMapper.getLanguageUsingId(6);
  Assert.assertNull(language);
  languageMapper.deleteLanguage(0);
}

Fixed version (ground truth):
/** 
 * 测试用例: 测试deleteLanguage(int)方法 测试数据: 不存在的编程语言唯一标识符 预期结果: 方法正常执行, 未影响数据表中的数据
 */
@Test public void testDeleteLanguageNotExists(){
  Language language=languageMapper.getLanguageUsingId(0);
  Assert.assertNull(language);
  languageMapper.deleteLanguage(0);
}
Program: 57719
Project: 57719
Buggy source:
/** 
 * Enables or Disables the Antenna Port Power of the HackRF. Note: This function interacts with the USB Hardware and should not be called from a GUI Thread!
 * @param enable		true for enable or false for disable
 * @return 	true on success
 * @throws HackrfUsbException
 */
public boolean setAntennaPower(boolean enable) throws HackrfUsbException {
  if (this.sendUsbRequest(UsbConstants.USB_DIR_OUT,HACKRF_VENDOR_REQUEST_ANTENNA_ENABLE,(enable ? 1 : 0),0,null) != 0) {
    Log.e(logTag,"String_Node_Str");
    throw (new HackrfUsbException("String_Node_Str"));
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Enables or Disables the Antenna Port Power of the HackRF. Note: This function interacts with the USB Hardware and should not be called from a GUI Thread!
 * @param enable		true for enable or false for disable
 * @return 	true on success
 * @throws HackrfUsbException
 */
public boolean setAntennaPower(boolean enable) throws HackrfUsbException {
  if (this.getBoardID() == 1) {
    Log.w(logTag,"String_Node_Str");
    return false;
  }
  if (this.sendUsbRequest(UsbConstants.USB_DIR_OUT,HACKRF_VENDOR_REQUEST_ANTENNA_ENABLE,(enable ? 1 : 0),0,null) != 0) {
    Log.e(logTag,"String_Node_Str");
    throw (new HackrfUsbException("String_Node_Str"));
  }
  return true;
}