nus-yam/ex-repair huggingface dataset:
Program: 35476
Project: 35476
Buggy source:
@Test public void map(){
  final RequestDto requestDto=RequestDtoMother.fundRequestArea51();
  final IssueInformationDto issueInformation=requestDto.getIssueInformation();
  final String status="String_Node_Str";
  final GithubResult githubResult=new GithubResult();
  githubResult.setBody("String_Node_Str");
  when(delegate.map(requestDto)).thenReturn(new RequestDetailsView());
  when(githubGateway.getIssue(issueInformation.getOwner(),issueInformation.getRepo(),issueInformation.getNumber())).thenReturn(githubResult);
  when(enumToCapitalizedStringMapper.map(requestDto.getStatus())).thenReturn(status);
  final RequestDetailsView result=decorator.map(requestDto);
  assertThat(result.getIcon()).isEqualTo("String_Node_Str" + issueInformation.getOwner() + "String_Node_Str");
  assertThat(result.getPlatform()).isEqualTo(issueInformation.getPlatform().name());
  assertThat(result.getOwner()).isEqualTo(issueInformation.getOwner());
  assertThat(result.getRepo()).isEqualTo(issueInformation.getRepo());
  assertThat(result.getIssueNumber()).isEqualTo(issueInformation.getNumber());
  assertThat(result.getTitle()).isEqualTo(issueInformation.getTitle());
  assertThat(result.getStarred()).isEqualTo(requestDto.isLoggedInUserIsWatcher());
  assertThat(result.getStatus()).isEqualTo(status);
  assertThat(result.getDescription()).isEqualTo(githubResult.getBody());
}

Fixed version (ground truth):
@Test public void map(){
  final RequestDto requestDto=RequestDtoMother.fundRequestArea51();
  final IssueInformationDto issueInformation=requestDto.getIssueInformation();
  final String status="String_Node_Str";
  final GithubResult githubResult=new GithubResult();
  githubResult.setBodyHtml("String_Node_Str");
  when(delegate.map(requestDto)).thenReturn(new RequestDetailsView());
  when(githubGateway.getIssue(issueInformation.getOwner(),issueInformation.getRepo(),issueInformation.getNumber())).thenReturn(githubResult);
  when(enumToCapitalizedStringMapper.map(requestDto.getStatus())).thenReturn(status);
  final RequestDetailsView result=decorator.map(requestDto);
  assertThat(result.getIcon()).isEqualTo("String_Node_Str" + issueInformation.getOwner() + "String_Node_Str");
  assertThat(result.getPlatform()).isEqualTo(issueInformation.getPlatform().name());
  assertThat(result.getOwner()).isEqualTo(issueInformation.getOwner());
  assertThat(result.getRepo()).isEqualTo(issueInformation.getRepo());
  assertThat(result.getIssueNumber()).isEqualTo(issueInformation.getNumber());
  assertThat(result.getTitle()).isEqualTo(issueInformation.getTitle());
  assertThat(result.getStarred()).isEqualTo(requestDto.isLoggedInUserIsWatcher());
  assertThat(result.getStatus()).isEqualTo(status);
  assertThat(result.getDescription()).isEqualTo(githubResult.getBodyHtml());
}
Program: 35477
Project: 35477
Buggy source:
public List<UserFundsDto> aggregate(final List<FundsByFunderDto> fundsByFunder){
  return fundsByFunder.stream().collect(Collectors.groupingBy(funds -> funds.getFunderAddress() + funds.getFunderUserId(),Collectors.mapping(mapToUserFundDto(),Collectors.reducing(mergeFundsAndRefunds())))).values().stream().filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
}

Fixed version (ground truth):
public List<UserFundsDto> aggregate(final List<FundsByFunderDto> fundsByFunder){
  return fundsByFunder.stream().collect(Collectors.groupingBy(funds -> funds.getFunderAddress().toLowerCase() + funds.getFunderUserId(),Collectors.mapping(mapToUserFundDto(),Collectors.reducing(mergeFundsAndRefunds())))).values().stream().filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
}
Program: 35478
Project: 35478
Buggy source:
@Test public void aggregate(){
  final String funder1UserId="String_Node_Str";
  final String funder1Address="String_Node_Str";
  final String funder2UserId="String_Node_Str";
  final String funder2Address="String_Node_Str";
  final String funder3UserId="String_Node_Str";
  final String funder3Address="String_Node_Str";
  final FundsByFunderDto fundsByFunderDto1=buildFundsByFunderDto(funder1UserId,funder1Address,"String_Node_Str","String_Node_Str");
  final FundsByFunderDto fundsByFunderDto2=buildFundsByFunderDto(funder2UserId,funder2Address,null,"String_Node_Str");
  final FundsByFunderDto fundsByFunderDto3=buildFundsByFunderDto(funder3UserId,funder3Address,"String_Node_Str",null);
  final FundsByFunderDto fundsByFunderDto4=buildFundsByFunderDto(funder1UserId,funder1Address,"String_Node_Str","String_Node_Str");
  final FundsByFunderDto fundsByFunderDto5=buildFundsByFunderDto(funder2UserId,funder2Address,null,"String_Node_Str");
  final FundsByFunderDto fundsByFunderDto6=buildFundsByFunderDto(funder3UserId,funder3Address,"String_Node_Str",null);
  final List<UserFundsDto> result=fundsAndRefundsAggregator.aggregate(Arrays.asList(fundsByFunderDto1,fundsByFunderDto2,fundsByFunderDto3,fundsByFunderDto4,fundsByFunderDto5,fundsByFunderDto6));
  assertThat(result).contains(buildUserFundsDtoFrom(fundsByFunderDto1,fundsByFunderDto4),buildUserFundsDtoFrom(fundsByFunderDto5,fundsByFunderDto2),buildUserFundsDtoFrom(fundsByFunderDto3,fundsByFunderDto6));
}

Fixed version (ground truth):
@Test public void aggregate(){
  final String funder1UserId="String_Node_Str";
  final String funder1Address="String_Node_Str";
  final String funder2UserId="String_Node_Str";
  final String funder2Address="String_Node_Str";
  final String funder3UserId="String_Node_Str";
  final String funder3Address="String_Node_Str";
  final FundsByFunderDto fundsByFunderDto1=buildFundsByFunderDto(funder1UserId,funder1Address,"String_Node_Str","String_Node_Str");
  final FundsByFunderDto fundsByFunderDto2=buildFundsByFunderDto(funder2UserId,funder2Address,null,"String_Node_Str");
  final FundsByFunderDto fundsByFunderDto3=buildFundsByFunderDto(funder3UserId,funder3Address,"String_Node_Str",null);
  final FundsByFunderDto fundsByFunderDto4=buildFundsByFunderDto(funder1UserId,funder1Address.toUpperCase(),"String_Node_Str","String_Node_Str");
  final FundsByFunderDto fundsByFunderDto5=buildFundsByFunderDto(funder2UserId,funder2Address,null,"String_Node_Str");
  final FundsByFunderDto fundsByFunderDto6=buildFundsByFunderDto(funder3UserId,funder3Address,"String_Node_Str",null);
  final List<UserFundsDto> result=fundsAndRefundsAggregator.aggregate(Arrays.asList(fundsByFunderDto1,fundsByFunderDto2,fundsByFunderDto3,fundsByFunderDto4,fundsByFunderDto5,fundsByFunderDto6));
  assertThat(result).contains(buildUserFundsDtoFrom(fundsByFunderDto1,fundsByFunderDto4),buildUserFundsDtoFrom(fundsByFunderDto5,fundsByFunderDto2),buildUserFundsDtoFrom(fundsByFunderDto3,fundsByFunderDto6));
}
Program: 35479
Project: 35479
Buggy source:
public String resolve(final Document document,final String owner,final String repo){
  return document.select("String_Node_Str").stream().filter(this::isPullRequest).filter(this::isMerged).map(discussionItem -> getAuthor(discussionItem,owner,repo)).filter(StringUtils::isNotEmpty).findFirst().orElse(null);
}

Fixed version (ground truth):
public String resolve(final Document document,final String owner,final String repo){
  return document.select("String_Node_Str").stream().filter(this::isPullRequest).filter(this::isMerged).map(this::resolvePullRequestNumber).map(pullRequestNumber -> fetchAuthorFromPullRequest(pullRequestNumber,owner,repo)).filter(StringUtils::isNotEmpty).findFirst().orElse(null);
}
Program: 35480
Project: 35480
Buggy source:
public DiscussionItemBuilder isPullRequest(boolean isPullRequest,final String number){
  isPullRequest(isPullRequest);
  final Elements pullRequestElements=mock(Elements.class);
  when(pullRequestElements.text()).thenReturn(number);
  when(element.select("String_Node_Str")).thenReturn(pullRequestElements);
  return this;
}

Fixed version (ground truth):
public DiscussionItemBuilder isPullRequest(boolean isPullRequest){
  final Elements pullRequestElements=mock(Elements.class);
  when(pullRequestElements.isEmpty()).thenReturn(!isPullRequest);
  when(element.select("String_Node_Str")).thenReturn(pullRequestElements);
  return this;
}
Program: 35481
Project: 35481
Buggy source:
@Test public void parse_pullRequestMerged_noSolverOnPage(){
  final String owner="String_Node_Str";
  final String repo="String_Node_Str";
  final String solver="String_Node_Str";
  final String pullrequestNumber="String_Node_Str";
  final Document doc=DocumentMockBuilder.documentBuilder().addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(false).build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true,"String_Node_Str").isMerged(false).withAuthor("String_Node_Str").build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true,pullrequestNumber).isMerged(true).withAuthor("String_Node_Str").build()).build();
  when(githubGateway.getPullrequest(owner,repo,pullrequestNumber)).thenReturn(GithubResult.builder().user(GithubUser.builder().login(solver).build()).build());
  final String returnedSolver=parser.resolve(doc,owner,repo);
  assertThat(returnedSolver).isEqualTo(solver);
}

Fixed version (ground truth):
@Test public void parse_pullRequestMerged_noSolverOnPage(){
  final String owner="String_Node_Str";
  final String repo="String_Node_Str";
  final String solver="String_Node_Str";
  final int pullrequestNumber=765;
  final Document doc=DocumentMockBuilder.documentBuilder().addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(false).build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true).isMerged(false).withAuthor("String_Node_Str").withIssueNum(53,false).build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true).isMerged(true).withAuthor("String_Node_Str").withIssueNum(pullrequestNumber,true).build()).build();
  when(githubGateway.getPullrequest(owner,repo,String.valueOf(pullrequestNumber))).thenReturn(GithubResult.builder().user(GithubUser.builder().login(solver).build()).build());
  final String returnedSolver=parser.resolve(doc,owner,repo);
  assertThat(returnedSolver).isEqualTo(solver);
}
Program: 35482
Project: 35482
Buggy source:
@Test public void parse_noSolver(){
  final String owner="String_Node_Str";
  final String repo="String_Node_Str";
  final String pullrequestNumber="String_Node_Str";
  final Document doc=DocumentMockBuilder.documentBuilder().addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(false).build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true,"String_Node_Str").isMerged(false).withAuthor("String_Node_Str").build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true,pullrequestNumber).isMerged(true).withAuthor("String_Node_Str").build()).build();
  when(githubGateway.getPullrequest(owner,repo,pullrequestNumber)).thenReturn(GithubResult.builder().user(GithubUser.builder().login("String_Node_Str").build()).build());
  final String returnedSolver=parser.resolve(doc,owner,repo);
  assertThat(returnedSolver).isNull();
}

Fixed version (ground truth):
@Test public void parse_noSolver(){
  final String owner="String_Node_Str";
  final String repo="String_Node_Str";
  final int pullrequestNumber=43;
  final Document doc=DocumentMockBuilder.documentBuilder().addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(false).build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true).isMerged(false).withIssueNum(31,false).withAuthor("String_Node_Str").build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true).isMerged(true).withAuthor("String_Node_Str").withIssueNum(pullrequestNumber,true).build()).build();
  when(githubGateway.getPullrequest(owner,repo,String.valueOf(pullrequestNumber))).thenReturn(GithubResult.builder().user(GithubUser.builder().login("String_Node_Str").build()).build());
  final String returnedSolver=parser.resolve(doc,owner,repo);
  assertThat(returnedSolver).isNull();
}
Program: 35483
Project: 35483
Buggy source:
@Test public void parse(){
  final String owner="String_Node_Str";
  final String repo="String_Node_Str";
  final String solver="String_Node_Str";
  final String pullrequestNumber="String_Node_Str";
  final Document doc=DocumentMockBuilder.documentBuilder().addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(false).build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true,"String_Node_Str").isMerged(false).withAuthor("String_Node_Str").build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true,pullrequestNumber).isMerged(true).withAuthor(solver).build()).build();
  when(githubGateway.getPullrequest(owner,repo,pullrequestNumber)).thenReturn(GithubResult.builder().user(GithubUser.builder().login(solver).build()).build());
  final String returnedSolver=parser.resolve(doc,owner,repo);
  assertThat(returnedSolver).isEqualTo(solver);
}

Fixed version (ground truth):
@Test public void parse(){
  final String owner="String_Node_Str";
  final String repo="String_Node_Str";
  final String solver="String_Node_Str";
  final int pullrequestNumber=765;
  final Document doc=DocumentMockBuilder.documentBuilder().addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(false).build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true).isMerged(false).withAuthor("String_Node_Str").withIssueNum(53,false).build()).addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true).isMerged(true).withAuthor("String_Node_Str").withIssueNum(pullrequestNumber,false).build()).build();
  when(githubGateway.getPullrequest(owner,repo,String.valueOf(pullrequestNumber))).thenReturn(GithubResult.builder().user(GithubUser.builder().login(solver).build()).build());
  final String returnedSolver=parser.resolve(doc,owner,repo);
  assertThat(returnedSolver).isEqualTo(solver);
}
Program: 35484
Project: 35484
Buggy source:
@Test public void parse_noMergedPullRequest(){
  final String owner="String_Node_Str";
  final String repo="String_Node_Str";
  final Document doc=DocumentMockBuilder.documentBuilder().addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true,"String_Node_Str").isMerged(false).withAuthor("String_Node_Str").build()).build();
  final String returnedSolver=parser.resolve(doc,owner,repo);
  assertThat(returnedSolver).isNull();
}

Fixed version (ground truth):
@Test public void parse_noMergedPullRequest(){
  final String owner="String_Node_Str";
  final String repo="String_Node_Str";
  final Document doc=DocumentMockBuilder.documentBuilder().addDiscussionItem(DocumentMockBuilder.discussionItemBuilder().isPullRequest(true).withIssueNum(53,false).isMerged(false).withAuthor("String_Node_Str").build()).build();
  final String returnedSolver=parser.resolve(doc,owner,repo);
  assertThat(returnedSolver).isNull();
}
Program: 35485
Project: 35485
Buggy source:
public ProfileController(final ApplicationEventPublisher eventPublisher,final ProfileService profileService,final ReferralService referralService,final GithubBountyService githubBountyService,final StackOverflowBountyService stackOverflowBountyService){
  this.eventPublisher=eventPublisher;
  this.profileService=profileService;
  this.referralService=referralService;
  this.githubBountyService=githubBountyService;
  this.stackOverflowBountyService=stackOverflowBountyService;
}

Fixed version (ground truth):
public ProfileController(final ApplicationEventPublisher eventPublisher,final ProfileService profileService,final ReferralService referralService,final GithubBountyService githubBountyService,final StackOverflowBountyService stackOverflowBountyService,final FAQService faqService){
  this.eventPublisher=eventPublisher;
  this.profileService=profileService;
  this.referralService=referralService;
  this.githubBountyService=githubBountyService;
  this.stackOverflowBountyService=stackOverflowBountyService;
  this.faqService=faqService;
}
Program: 35486
Project: 35486
Buggy source:
@GetMapping("String_Node_Str") public ModelAndView showProfile(Principal principal,@RequestParam(value="String_Node_Str",required=false) String ref) throws Exception {
  if (StringUtils.isNotBlank(ref)) {
    eventPublisher.publishEvent(RefSignupEvent.builder().principal(principal).ref(ref).build());
    return redirectToProfile();
  }
  final ModelAndView mav=new ModelAndView("String_Node_Str");
  mav.addObject("String_Node_Str",isVerifiedGithub(principal));
  mav.addObject("String_Node_Str",isVerifiedStackOverflow(principal));
  mav.addObject("String_Node_Str",getRefLink(principal,"String_Node_Str"));
  mav.addObject("String_Node_Str",URLEncoder.encode(getRefLink(principal,"String_Node_Str"),"String_Node_Str"));
  mav.addObject("String_Node_Str",URLEncoder.encode(getRefLink(principal,"String_Node_Str"),"String_Node_Str"));
  mav.addObject("String_Node_Str",URLEncoder.encode(getRefLink(principal,"String_Node_Str"),"String_Node_Str"));
  return mav;
}

Fixed version (ground truth):
@GetMapping("String_Node_Str") public ModelAndView showProfile(Principal principal,@RequestParam(value="String_Node_Str",required=false) String ref) throws Exception {
  if (StringUtils.isNotBlank(ref)) {
    eventPublisher.publishEvent(RefSignupEvent.builder().principal(principal).ref(ref).build());
    return redirectToProfile();
  }
  final ModelAndView mav=new ModelAndView("String_Node_Str");
  mav.addObject("String_Node_Str",isVerifiedGithub(principal));
  mav.addObject("String_Node_Str",isVerifiedStackOverflow(principal));
  mav.addObject("String_Node_Str",getRefLink(principal,"String_Node_Str"));
  mav.addObject("String_Node_Str",URLEncoder.encode(getRefLink(principal,"String_Node_Str"),"String_Node_Str"));
  mav.addObject("String_Node_Str",URLEncoder.encode(getRefLink(principal,"String_Node_Str"),"String_Node_Str"));
  mav.addObject("String_Node_Str",URLEncoder.encode(getRefLink(principal,"String_Node_Str"),"String_Node_Str"));
  mav.addObject("String_Node_Str",faqService.getFAQsForPage(FAQ_PROFILE_KEY));
  return mav;
}
Program: 35487
Project: 35487
Buggy source:
@Transactional public void save(Principal principal,final PendingFundCommand command){
  final IssueInformation issueInformation=githubLinkParser.parseIssue(command.getPlatformId());
  PendingFund pf=PendingFund.builder().amount(toWei(command)).description(command.getDescription()).fromAddress(command.getFromAddress()).tokenAddress(command.getTokenAddress()).transactionhash(command.getTransactionId()).issueInformation(issueInformation).userId(principal == null ? null : principal.getName()).build();
  pendingFundRepository.save(pf);
}

Fixed version (ground truth):
@Transactional public void save(final Principal principal,final PendingFundCommand command){
  final IssueInformation issueInformation=githubLinkParser.parseIssue(command.getPlatformId());
  final PendingFund pf=PendingFund.builder().amount(toWei(command)).description(command.getDescription()).fromAddress(command.getFromAddress()).tokenAddress(command.getTokenAddress()).transactionhash(command.getTransactionId()).issueInformation(issueInformation).userId(principal == null ? null : principal.getName()).build();
  pendingFundRepository.save(pf);
}
Program: 35488
Project: 35488
Buggy source:
@Transactional(readOnly=true) public List<PendingFundDto> findByUser(Principal principal){
  return mappers.mapList(PendingFund.class,PendingFundDto.class,pendingFundRepository.findByUserId(principal.getName()));
}

Fixed version (ground truth):
@Transactional(readOnly=true) public List<PendingFundDto> findByUser(final Principal principal){
  return mappers.mapList(PendingFund.class,PendingFundDto.class,pendingFundRepository.findByUserId(principal.getName()));
}
Program: 35489
Project: 35489
Buggy source:
public String getTokenImage(){
  if (StringUtils.isNotBlank(tokenAddress)) {
    return "String_Node_Str" + tokenAddress.toLowerCase() + "String_Node_Str";
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
public String getTokenImage(){
  if (StringUtils.isNotBlank(tokenSymbol)) {
    return tokenSymbol.toLowerCase() + "String_Node_Str";
  }
 else {
    return "String_Node_Str";
  }
}
Program: 35490
Project: 35490
Buggy source:
@Override protected void configure(HttpSecurity http) throws Exception {
  super.configure(http);
  http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED).and().csrf().disable().authorizeRequests().antMatchers("String_Node_Str","String_Node_Str").authenticated().antMatchers("String_Node_Str","String_Node_Str").authenticated().antMatchers("String_Node_Str","String_Node_Str").authenticated().anyRequest().permitAll();
}

Fixed version (ground truth):
@Override protected void configure(HttpSecurity http) throws Exception {
  super.configure(http);
  http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED).and().csrf().disable().authorizeRequests().antMatchers("String_Node_Str","String_Node_Str").authenticated().antMatchers("String_Node_Str","String_Node_Str").authenticated().antMatchers("String_Node_Str","String_Node_Str","String_Node_Str").authenticated().anyRequest().permitAll();
}
Program: 35491
Project: 35491
Buggy source:
@NotNull private BigInteger toWei(PendingFundCommand command){
  final TokenInfoDto tokenInfo=tokenInfoService.getTokenInfo(command.getTokenAddress());
  final BigDecimal multiplier=BigDecimal.TEN.pow(tokenInfo.getDecimals());
  return new BigDecimal(command.getAmount()).multiply(multiplier).toBigInteger();
}

Fixed version (ground truth):
@NotNull private BigInteger toWei(PendingFundCommand command){
  final TokenInfoDto tokenInfo=tokenInfoService.getTokenInfo(command.getTokenAddress());
  return EthUtil.toWei(new BigDecimal(command.getAmount()),tokenInfo.getDecimals()).toBigInteger();
}
Program: 35492
Project: 35492
Buggy source:
@Override public RequestClaimDto map(RequestClaim r){
  RequestClaimDto dto=delegate.map(r);
  if (dto != null) {
    RequestDto request=requestService.findRequest(dto.getId());
    dto.setUrl(createLink(request.getIssueInformation()));
  }
  return dto;
}

Fixed version (ground truth):
@Override public RequestClaimDto map(RequestClaim r){
  RequestClaimDto dto=delegate.map(r);
  if (dto != null) {
    RequestDto request=requestService.findRequest(r.getRequestId());
    dto.setUrl(createLink(request.getIssueInformation()));
  }
  return dto;
}
Program: 35493
Project: 35493
Buggy source:
FundersDto getFundedBy(Long requestId);

Fixed version (ground truth):
FundersDto getFundedBy(Principal principal,Long requestId);
Program: 35494
Project: 35494
Buggy source:
@Override @Transactional(readOnly=true) public FundersDto getFundedBy(Long requestId){
  List<FunderDto> list=fundRepository.findByRequestId(requestId).stream().map(this::mapToFunderDto).filter(Objects::nonNull).collect(Collectors.toList());
  list=groupByFunder(list);
  enrichFundsWithZeroValues(list);
  TotalFundDto fndFunds=totalFndFunds(list);
  TotalFundDto otherFunds=totalOtherFunds(list);
  return FundersDto.builder().funders(list).fndFunds(fndFunds).otherFunds(otherFunds).usdFunds(fiatService.getUsdPrice(fndFunds,otherFunds)).build();
}

Fixed version (ground truth):
@Override @Transactional(readOnly=true) public FundersDto getFundedBy(Principal principal,Long requestId){
  List<FunderDto> list=fundRepository.findByRequestId(requestId).stream().map(r -> this.mapToFunderDto(principal == null ? null : profileService.getUserProfile(principal.getName()),r)).filter(Objects::nonNull).collect(Collectors.toList());
  list=groupByFunder(list);
  enrichFundsWithZeroValues(list);
  TotalFundDto fndFunds=totalFndFunds(list);
  TotalFundDto otherFunds=totalOtherFunds(list);
  return FundersDto.builder().funders(list).fndFunds(fndFunds).otherFunds(otherFunds).usdFunds(fiatService.getUsdPrice(fndFunds,otherFunds)).build();
}
Program: 35495
Project: 35495
Buggy source:
private FunderDto mapToFunderDto(Fund f){
  TotalFundDto totalFundDto=createTotalFund(f.getToken(),f.getAmountInWei());
  return totalFundDto == null ? null : FunderDto.builder().funder(StringUtils.isNotBlank(f.getFunderUserId()) ? profileService.getUserProfile(f.getFunderUserId()).getName() : f.getFunder()).fndFunds("String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).otherFunds(!"String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).build();
}

Fixed version (ground truth):
private FunderDto mapToFunderDto(UserProfile userProfile,Fund f){
  TotalFundDto totalFundDto=createTotalFund(f.getToken(),f.getAmountInWei());
  String funder=StringUtils.isNotBlank(f.getFunderUserId()) ? profileService.getUserProfile(f.getFunderUserId()).getName() : f.getFunder();
  return totalFundDto == null ? null : FunderDto.builder().funder(funder).fndFunds("String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).otherFunds(!"String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).isLoggedInUser(userProfile != null && (userProfile.getId().equals(f.getFunderUserId()) || f.getFunder().equals(userProfile.getEtherAddress()))).build();
}
Program: 35496
Project: 35496
Buggy source:
private List<FunderDto> groupByFunder(List<FunderDto> list){
  return list.stream().collect(Collectors.groupingBy(FunderDto::getFunder,Collectors.reducing(new BinaryOperator<FunderDto>(){
    @Override public FunderDto apply(    FunderDto a1,    FunderDto b1){
      if (a1 == null && b1 == null) {
        return null;
      }
 else       if (a1 == null) {
        return b1;
      }
 else       if (b1 == null) {
        return a1;
      }
      a1.setFndFunds(mergeFunds(a1.getFndFunds(),b1.getFndFunds()));
      a1.setOtherFunds(mergeFunds(a1.getOtherFunds(),b1.getOtherFunds()));
      return a1;
    }
  }
))).values().stream().filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
}

Fixed version (ground truth):
private List<FunderDto> groupByFunder(List<FunderDto> list){
  return list.stream().collect(Collectors.groupingBy(FunderDto::getFunder,Collectors.reducing((a1,b1) -> {
    if (a1 == null && b1 == null) {
      return null;
    }
 else     if (a1 == null) {
      return b1;
    }
 else     if (b1 == null) {
      return a1;
    }
    a1.setFndFunds(mergeFunds(a1.getFndFunds(),b1.getFndFunds()));
    a1.setOtherFunds(mergeFunds(a1.getOtherFunds(),b1.getOtherFunds()));
    return a1;
  }
))).values().stream().filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
}
Program: 35497
Project: 35497
Buggy source:
@Test public void fundedByHasTotalOther(){
  List<Fund> funds=Arrays.asList(FundMother.zrxFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.zrxFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(1L);
  assertThat(result.getFndFunds()).isNull();
  assertThat(result.getOtherFunds().getTokenSymbol()).isEqualTo("String_Node_Str");
  assertThat(result.getOtherFunds().getTokenAddress()).isEqualTo(funds.get(0).getToken());
  assertThat(result.getOtherFunds().getTotalAmount()).isEqualByComparingTo("String_Node_Str");
}

Fixed version (ground truth):
@Test public void fundedByHasTotalOther(){
  List<Fund> funds=Arrays.asList(FundMother.zrxFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.zrxFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(funder,1L);
  assertThat(result.getFndFunds()).isNull();
  assertThat(result.getOtherFunds().getTokenSymbol()).isEqualTo("String_Node_Str");
  assertThat(result.getOtherFunds().getTokenAddress()).isEqualTo(funds.get(0).getToken());
  assertThat(result.getOtherFunds().getTotalAmount()).isEqualByComparingTo("String_Node_Str");
}
Program: 35498
Project: 35498
Buggy source:
@Test public void saveFunds(){
  Request request=RequestMother.freeCodeCampNoUserStories().build();
  FundsAddedCommand command=FundsAddedCommand.builder().requestId(request.getId()).amountInWei(BigDecimal.TEN).transactionId("String_Node_Str").funderAddress("String_Node_Str").timestamp(LocalDateTime.now()).token("String_Node_Str").build();
  when(requestRepository.findOne(request.getId())).thenReturn(Optional.of(request));
  Principal funder=() -> "String_Node_Str";
  FundDto fundDto=new FundDto();
  when(mappers.map(eq(Fund.class),eq(FundDto.class),any(Fund.class))).thenReturn(fundDto);
  RequestDto requestDto=new RequestDto();
  when(mappers.map(eq(Request.class),eq(RequestDto.class),any(Request.class))).thenReturn(requestDto);
  Cache cache=mock(Cache.class);
  when(cacheManager.getCache("String_Node_Str")).thenReturn(cache);
  when(pendingFundRepository.findByTransactionHash(command.getTransactionId())).thenReturn(Optional.of(PendingFund.builder().userId(funder.getName()).build()));
  fundService.addFunds(command);
  verifyFundsSaved(command,funder);
  verifyEventCreated(requestDto,fundDto);
  verify(cache).evict(request.getId());
}

Fixed version (ground truth):
@Test public void saveFunds(){
  Request request=RequestMother.freeCodeCampNoUserStories().build();
  FundsAddedCommand command=FundsAddedCommand.builder().requestId(request.getId()).amountInWei(BigDecimal.TEN).transactionId("String_Node_Str").funderAddress("String_Node_Str").timestamp(LocalDateTime.now()).token("String_Node_Str").build();
  when(requestRepository.findOne(request.getId())).thenReturn(Optional.of(request));
  FundDto fundDto=new FundDto();
  when(mappers.map(eq(Fund.class),eq(FundDto.class),any(Fund.class))).thenReturn(fundDto);
  RequestDto requestDto=new RequestDto();
  when(mappers.map(eq(Request.class),eq(RequestDto.class),any(Request.class))).thenReturn(requestDto);
  Cache cache=mock(Cache.class);
  when(cacheManager.getCache("String_Node_Str")).thenReturn(cache);
  when(pendingFundRepository.findByTransactionHash(command.getTransactionId())).thenReturn(Optional.of(PendingFund.builder().userId(funder.getName()).build()));
  fundService.addFunds(command);
  verifyFundsSaved(command,funder);
  verifyEventCreated(requestDto,fundDto);
  verify(cache).evict(request.getId());
}
Program: 35499
Project: 35499
Buggy source:
@Test public void fundedByHasNameFunderAddress(){
  List<Fund> funds=Collections.singletonList(FundMother.fndFundFunderNotKnown().build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(1L);
  assertThat(result.getFunders().get(0).getFunder()).isEqualTo(funds.get(0).getFunder());
}

Fixed version (ground truth):
@Test public void fundedByHasNameFunderAddress(){
  List<Fund> funds=Collections.singletonList(FundMother.fndFundFunderNotKnown().build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(funder,1L);
  assertThat(result.getFunders().get(0).getFunder()).isEqualTo(funds.get(0).getFunder());
}
Program: 35500
Project: 35500
Buggy source:
@Test public void fundedByHasTotalFnd(){
  List<Fund> funds=Arrays.asList(FundMother.fndFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.fndFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(1L);
  assertThat(result.getOtherFunds()).isNull();
  assertThat(result.getFndFunds().getTokenSymbol()).isEqualTo("String_Node_Str");
  assertThat(result.getFndFunds().getTokenAddress()).isEqualTo(funds.get(0).getToken());
  assertThat(result.getFndFunds().getTotalAmount()).isEqualByComparingTo("String_Node_Str");
}

Fixed version (ground truth):
@Test public void fundedByHasTotalFnd(){
  List<Fund> funds=Arrays.asList(FundMother.fndFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.fndFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(funder,1L);
  assertThat(result.getOtherFunds()).isNull();
  assertThat(result.getFndFunds().getTokenSymbol()).isEqualTo("String_Node_Str");
  assertThat(result.getFndFunds().getTokenAddress()).isEqualTo(funds.get(0).getToken());
  assertThat(result.getFndFunds().getTotalAmount()).isEqualByComparingTo("String_Node_Str");
}
Program: 35501
Project: 35501
Buggy source:
@Test public void mergesSameFunderData(){
  List<Fund> funds=Arrays.asList(FundMother.fndFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.zrxFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.zrxFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.fndFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(1L);
  assertThat(result.getFunders()).hasSize(1);
  assertThat(result.getFunders().get(0).getOtherFunds().getTotalAmount()).isEqualByComparingTo(new BigDecimal("String_Node_Str"));
  assertThat(result.getFunders().get(0).getFndFunds().getTotalAmount()).isEqualByComparingTo(new BigDecimal("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void mergesSameFunderData(){
  List<Fund> funds=Arrays.asList(FundMother.fndFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.zrxFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.zrxFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.fndFundFunderNotKnown().amountInWei(new BigDecimal("String_Node_Str")).build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(funder,1L);
  assertThat(result.getFunders()).hasSize(1);
  assertThat(result.getFunders().get(0).getOtherFunds().getTotalAmount()).isEqualByComparingTo(new BigDecimal("String_Node_Str"));
  assertThat(result.getFunders().get(0).getFndFunds().getTotalAmount()).isEqualByComparingTo(new BigDecimal("String_Node_Str"));
}
Program: 35502
Project: 35502
Buggy source:
@Before public void setUp(){
  fundRepository=mock(FundRepository.class);
  pendingFundRepository=mock(PendingFundRepository.class);
  requestRepository=mock(RequestRepository.class);
  mappers=mock(Mappers.class);
  eventPublisher=mock(ApplicationEventPublisher.class);
  cacheManager=mock(CacheManager.class,RETURNS_DEEP_STUBS);
  tokenInfoService=mock(TokenInfoService.class);
  fundRequestContractsService=mock(FundRequestContractsService.class);
  profileService=mock(ProfileService.class);
  fiatService=mock(FiatService.class);
  when(fundRepository.saveAndFlush(any(Fund.class))).then(returnsFirstArg());
  fundService=new FundServiceImpl(fundRepository,pendingFundRepository,requestRepository,mappers,eventPublisher,cacheManager,tokenInfoService,fundRequestContractsService,profileService,fiatService);
}

Fixed version (ground truth):
@Before public void setUp(){
  fundRepository=mock(FundRepository.class);
  pendingFundRepository=mock(PendingFundRepository.class);
  requestRepository=mock(RequestRepository.class);
  mappers=mock(Mappers.class);
  eventPublisher=mock(ApplicationEventPublisher.class);
  cacheManager=mock(CacheManager.class,RETURNS_DEEP_STUBS);
  tokenInfoService=mock(TokenInfoService.class);
  fundRequestContractsService=mock(FundRequestContractsService.class);
  profileService=mock(ProfileService.class);
  fiatService=mock(FiatService.class);
  when(fundRepository.saveAndFlush(any(Fund.class))).then(returnsFirstArg());
  UserProfile user=UserProfileMother.davy();
  funder=user::getId;
  when(profileService.getUserProfile(funder.getName())).thenReturn(user);
  fundService=new FundServiceImpl(fundRepository,pendingFundRepository,requestRepository,mappers,eventPublisher,cacheManager,tokenInfoService,fundRequestContractsService,profileService,fiatService);
}
Program: 35503
Project: 35503
Buggy source:
@Test public void fundByEnrichedWithZeroes(){
  List<Fund> funds=Arrays.asList(FundMother.fndFundFunderNotKnown().funder("String_Node_Str").amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.zrxFundFunderNotKnown().funder("String_Node_Str").amountInWei(new BigDecimal("String_Node_Str")).build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(1L);
  assertThat(result.getFunders().get(0).getOtherFunds().getTotalAmount()).isEqualByComparingTo(BigDecimal.ZERO);
  assertThat(result.getFunders().get(1).getFndFunds().getTotalAmount()).isEqualByComparingTo(BigDecimal.ZERO);
}

Fixed version (ground truth):
@Test public void fundByEnrichedWithZeroes(){
  List<Fund> funds=Arrays.asList(FundMother.fndFundFunderNotKnown().funder("String_Node_Str").amountInWei(new BigDecimal("String_Node_Str")).build(),FundMother.zrxFundFunderNotKnown().funder("String_Node_Str").amountInWei(new BigDecimal("String_Node_Str")).build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  FundersDto result=fundService.getFundedBy(funder,1L);
  assertThat(result.getFunders().get(0).getOtherFunds().getTotalAmount()).isEqualByComparingTo(BigDecimal.ZERO);
  assertThat(result.getFunders().get(1).getFndFunds().getTotalAmount()).isEqualByComparingTo(BigDecimal.ZERO);
}
Program: 35504
Project: 35504
Buggy source:
@Test public void fundedByHasNameFunder(){
  List<Fund> funds=Collections.singletonList(FundMother.fndFundFunderKnown().build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  UserProfile davy=UserProfileMother.davy();
  when(profileService.getUserProfile(funds.get(0).getFunderUserId())).thenReturn(davy);
  FundersDto result=fundService.getFundedBy(1L);
  assertThat(result.getFunders().get(0).getFunder()).isEqualTo(davy.getName());
}

Fixed version (ground truth):
@Test public void fundedByHasNameFunder(){
  List<Fund> funds=Collections.singletonList(FundMother.fndFundFunderKnown().build());
  when(fundRepository.findByRequestId(1L)).thenReturn(funds);
  mockTokenInfo();
  UserProfile davy=UserProfileMother.davy();
  when(profileService.getUserProfile(funds.get(0).getFunderUserId())).thenReturn(davy);
  FundersDto result=fundService.getFundedBy(funder,1L);
  assertThat(result.getFunders().get(0).getFunder()).isEqualTo(davy.getName());
  assertThat(result.getFunders().get(0).isLoggedInUser()).isTrue();
}
Program: 35505
Project: 35505
Buggy source:
FundersDto getFundedBy(Long requestId);

Fixed version (ground truth):
FundersDto getFundedBy(Principal principal,Long requestId);
Program: 35506
Project: 35506
Buggy source:
@Override @Transactional(readOnly=true) public FundersDto getFundedBy(Long requestId){
  List<FunderDto> list=fundRepository.findByRequestId(requestId).stream().map(this::mapToFunderDto).filter(Objects::nonNull).collect(Collectors.toList());
  list=groupByFunder(list);
  enrichFundsWithZeroValues(list);
  TotalFundDto fndFunds=totalFndFunds(list);
  TotalFundDto otherFunds=totalOtherFunds(list);
  return FundersDto.builder().funders(list).fndFunds(fndFunds).otherFunds(otherFunds).usdFunds(fiatService.getUsdPrice(fndFunds,otherFunds)).build();
}

Fixed version (ground truth):
@Override @Transactional(readOnly=true) public FundersDto getFundedBy(Principal principal,Long requestId){
  List<FunderDto> list=fundRepository.findByRequestId(requestId).stream().map(r -> this.mapToFunderDto(principal == null ? null : profileService.getUserProfile(principal.getName()),r)).filter(Objects::nonNull).collect(Collectors.toList());
  list=groupByFunder(list);
  enrichFundsWithZeroValues(list);
  TotalFundDto fndFunds=totalFndFunds(list);
  TotalFundDto otherFunds=totalOtherFunds(list);
  return FundersDto.builder().funders(list).fndFunds(fndFunds).otherFunds(otherFunds).usdFunds(fiatService.getUsdPrice(fndFunds,otherFunds)).build();
}
Program: 35507
Project: 35507
Buggy source:
private FunderDto mapToFunderDto(Fund f){
  TotalFundDto totalFundDto=createTotalFund(f.getToken(),f.getAmountInWei());
  return totalFundDto == null ? null : FunderDto.builder().funder(StringUtils.isNotBlank(f.getFunderUserId()) ? profileService.getUserProfile(f.getFunderUserId()).getName() : f.getFunder()).fndFunds("String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).otherFunds(!"String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).build();
}

Fixed version (ground truth):
private FunderDto mapToFunderDto(UserProfile userProfile,Fund f){
  TotalFundDto totalFundDto=createTotalFund(f.getToken(),f.getAmountInWei());
  String funder=StringUtils.isNotBlank(f.getFunderUserId()) ? profileService.getUserProfile(f.getFunderUserId()).getName() : f.getFunder();
  return totalFundDto == null ? null : FunderDto.builder().funder(funder).fndFunds("String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).otherFunds(!"String_Node_Str".equalsIgnoreCase(totalFundDto.getTokenSymbol()) ? totalFundDto : null).isLoggedInUser(userProfile != null && (userProfile.getId().equals(f.getFunderUserId()) || f.getFunder().equals(userProfile.getEtherAddress()))).build();
}
Program: 35508
Project: 35508
Buggy source:
private List<FunderDto> groupByFunder(List<FunderDto> list){
  return list.stream().collect(Collectors.groupingBy(FunderDto::getFunder,Collectors.reducing(new BinaryOperator<FunderDto>(){
    @Override public FunderDto apply(    FunderDto a1,    FunderDto b1){
      if (a1 == null && b1 == null) {
        return null;
      }
 else       if (a1 == null) {
        return b1;
      }
 else       if (b1 == null) {
        return a1;
      }
      a1.setFndFunds(mergeFunds(a1.getFndFunds(),b1.getFndFunds()));
      a1.setOtherFunds(mergeFunds(a1.getOtherFunds(),b1.getOtherFunds()));
      return a1;
    }
  }
))).values().stream().filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
}

Fixed version (ground truth):
private List<FunderDto> groupByFunder(List<FunderDto> list){
  return list.stream().collect(Collectors.groupingBy(FunderDto::getFunder,Collectors.reducing((a1,b1) -> {
    if (a1 == null && b1 == null) {
      return null;
    }
 else     if (a1 == null) {
      return b1;
    }
 else     if (b1 == null) {
      return a1;
    }
    a1.setFndFunds(mergeFunds(a1.getFndFunds(),b1.getFndFunds()));
    a1.setOtherFunds(mergeFunds(a1.getOtherFunds(),b1.getOtherFunds()));
    return a1;
  }
))).values().stream().filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
}
Program: 35509
Project: 35509
Buggy source:
public HomeController(FundRequestContractsService contractsService,ProfileService profileService){
  this.contractsService=contractsService;
  this.profileService=profileService;
}

Fixed version (ground truth):
public HomeController(ProfileService profileService){
  this.profileService=profileService;
}
Program: 35510
Project: 35510
Buggy source:
@RequestMapping("String_Node_Str") public ModelAndView home(){
  contractsService.fundRepository().getFundedTokenCount("String_Node_Str","String_Node_Str");
  return new ModelAndView("String_Node_Str");
}

Fixed version (ground truth):
@RequestMapping("String_Node_Str") public ModelAndView home(){
  return new ModelAndView("String_Node_Str");
}
Program: 35511
Project: 35511
Buggy source:
@Override public RequestClaimDto map(RequestClaim r){
  RequestClaimDto dto=delegate.map(r);
  if (dto != null) {
    RequestDto request=requestService.findRequest(dto.getId());
    dto.setUrl(createLink(request.getIssueInformation()));
  }
  return dto;
}

Fixed version (ground truth):
@Override public RequestClaimDto map(RequestClaim r){
  RequestClaimDto dto=delegate.map(r);
  if (dto != null) {
    RequestDto request=requestService.findRequest(r.getRequestId());
    dto.setUrl(createLink(request.getIssueInformation()));
  }
  return dto;
}
Program: 35512
Project: 35512
Buggy source:
@TransactionalEventListener(phase=TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event){
  if (addComment) {
    final RequestDto request=event.getRequestDto();
    final IssueInformationDto issueInformation=request.getIssueInformation();
    if (issueInformation.getPlatform() == Platform.GITHUB) {
      final CreateGithubComment comment=createComment(request);
      final List<GithubIssueCommentsResult> ourComments=getOurComments(issueInformation);
      if (ourComments.size() < 2) {
        placeNewComment(issueInformation,comment);
      }
 else {
        editLastComment(issueInformation,comment,ourComments);
      }
    }
  }
}

Fixed version (ground truth):
@TransactionalEventListener(phase=TransactionPhase.AFTER_COMMIT) public void createGithubCommentOnRequestClaimed(final RequestClaimedEvent event){
  if (addComment) {
    final RequestDto request=event.getRequestDto();
    final IssueInformationDto issueInformation=request.getIssueInformation();
    if (issueInformation.getPlatform() == Platform.GITHUB) {
      placeComment(request,issueInformation);
    }
  }
}
Program: 35513
Project: 35513
Buggy source:
private void editLastComment(IssueInformationDto issueInformation,CreateGithubComment comment,List<GithubIssueCommentsResult> ourComments){
  final GithubIssueCommentsResult lastComment=ourComments.stream().max(Comparator.comparing(GithubIssueCommentsResult::getCreatedAt)).orElseThrow(() -> new RuntimeException("String_Node_Str"));
  githubGateway.editCommentOnIssue(issueInformation.getOwner(),issueInformation.getRepo(),lastComment.getId(),comment);
}

Fixed version (ground truth):
private void editLastComment(final IssueInformationDto issueInformation,final CreateGithubComment comment,List<GithubIssueCommentsResult> ourComments){
  final GithubIssueCommentsResult lastComment=ourComments.stream().max(Comparator.comparing(GithubIssueCommentsResult::getCreatedAt)).orElseThrow(() -> new RuntimeException("String_Node_Str"));
  githubGateway.editCommentOnIssue(issueInformation.getOwner(),issueInformation.getRepo(),lastComment.getId(),comment);
}
Program: 35514
Project: 35514
Buggy source:
private void placeNewComment(IssueInformationDto issueInformation,CreateGithubComment comment){
  githubGateway.createCommentOnIssue(issueInformation.getOwner(),issueInformation.getRepo(),issueInformation.getNumber(),comment);
}

Fixed version (ground truth):
private void placeNewComment(final IssueInformationDto issueInformation,final CreateGithubComment comment){
  githubGateway.createCommentOnIssue(issueInformation.getOwner(),issueInformation.getRepo(),issueInformation.getNumber(),comment);
}