nus-yam/ex-repair huggingface dataset:
Program: 164531
Project: 164531
Buggy source:
private Result<TicketCategory> checkExistingCategory(TicketsInfo ti,Event event,String username){
  Category category=ti.getCategory();
  List<Attendee> attendees=ti.getAttendees();
  int tickets=attendees.size();
  int eventId=event.getId();
  TicketCategory existing=ticketCategoryRepository.getByIdAndActive(category.getExistingCategoryId(),eventId);
  int existingCategoryId=existing.getId();
  int freeTicketsInCategory=ticketRepository.countFreeTickets(eventId,existingCategoryId);
  int notAllocated=getNotAllocatedTickets(event);
  int missingTickets=Math.max(tickets - (freeTicketsInCategory + notAllocated),0);
  Event modified=increaseSeatsIfNeeded(ti,event,missingTickets,event);
  if (freeTicketsInCategory < tickets && existing.isBounded()) {
    int maxTickets=existing.getMaxTickets() + (tickets - freeTicketsInCategory);
    TicketCategoryModification tcm=new TicketCategoryModification(existingCategoryId,existing.getName(),maxTickets,DateTimeModification.fromZonedDateTime(existing.getInception(modified.getZoneId())),DateTimeModification.fromZonedDateTime(existing.getExpiration(event.getZoneId())),Collections.emptyMap(),existing.getPrice(),existing.isAccessRestricted(),"String_Node_Str",true,existing.getCode(),DateTimeModification.fromZonedDateTime(existing.getValidCheckInFrom(modified.getZoneId())),DateTimeModification.fromZonedDateTime(existing.getValidCheckInTo(modified.getZoneId())));
    return eventManager.updateCategory(existingCategoryId,modified,tcm,username);
  }
  return Result.success(existing);
}

Fixed version (ground truth):
private Result<TicketCategory> checkExistingCategory(TicketsInfo ti,Event event,String username){
  Category category=ti.getCategory();
  List<Attendee> attendees=ti.getAttendees();
  int tickets=attendees.size();
  int eventId=event.getId();
  TicketCategory existing=ticketCategoryRepository.getByIdAndActive(category.getExistingCategoryId(),eventId);
  int existingCategoryId=existing.getId();
  int freeTicketsInCategory=ticketRepository.countFreeTickets(eventId,existingCategoryId);
  int notAllocated=getNotAllocatedTickets(event);
  int missingTickets=Math.max(tickets - (freeTicketsInCategory + notAllocated),0);
  Event modified=increaseSeatsIfNeeded(ti,event,missingTickets,event);
  if (freeTicketsInCategory < tickets && existing.isBounded()) {
    int maxTickets=existing.getMaxTickets() + (tickets - freeTicketsInCategory);
    TicketCategoryModification tcm=new TicketCategoryModification(existingCategoryId,existing.getName(),maxTickets,DateTimeModification.fromZonedDateTime(existing.getInception(modified.getZoneId())),DateTimeModification.fromZonedDateTime(existing.getExpiration(event.getZoneId())),Collections.emptyMap(),existing.getPrice(),existing.isAccessRestricted(),"String_Node_Str",true,existing.getCode(),DateTimeModification.fromZonedDateTime(existing.getValidCheckInFrom(modified.getZoneId())),DateTimeModification.fromZonedDateTime(existing.getValidCheckInTo(modified.getZoneId())));
    return eventManager.updateCategory(existingCategoryId,modified,tcm,username,true);
  }
  return Result.success(existing);
}
Program: 164532
Project: 164532
Buggy source:
private void updateCategory(TicketCategoryModification tc,boolean freeOfCharge,ZoneId zoneId,Event event){
  int eventId=event.getId();
  final int price=evaluatePrice(tc.getPriceInCents(),freeOfCharge);
  TicketCategory original=ticketCategoryRepository.getByIdAndActive(tc.getId(),eventId);
  ticketCategoryRepository.update(tc.getId(),tc.getName(),tc.getInception().toZonedDateTime(zoneId),tc.getExpiration().toZonedDateTime(zoneId),tc.getMaxTickets(),tc.isTokenGenerationRequested(),price,StringUtils.trimToNull(tc.getCode()),DateTimeModification.toZonedDateTime(tc.getValidCheckInFrom(),zoneId),DateTimeModification.toZonedDateTime(tc.getValidCheckInTo(),(zoneId)));
  TicketCategory updated=ticketCategoryRepository.getByIdAndActive(tc.getId(),eventId);
  int addedTickets=0;
  if (original.isBounded() ^ tc.isBounded()) {
    handleTicketAllocationStrategyChange(event,original,tc);
  }
 else {
    addedTickets=updated.getMaxTickets() - original.getMaxTickets();
    handleTicketNumberModification(event,original,updated,addedTickets);
  }
  handleTokenModification(original,updated,addedTickets);
  handlePriceChange(event,original,updated);
  insertOrUpdateTicketCategoryDescription(tc.getId(),tc,event);
  auditingRepository.insertUpdateTicketInCategoryId(tc.getId());
}

Fixed version (ground truth):
private void updateCategory(TicketCategoryModification tc,boolean freeOfCharge,ZoneId zoneId,Event event,boolean resetTicketsToFree){
  int eventId=event.getId();
  final int price=evaluatePrice(tc.getPriceInCents(),freeOfCharge);
  TicketCategory original=ticketCategoryRepository.getByIdAndActive(tc.getId(),eventId);
  ticketCategoryRepository.update(tc.getId(),tc.getName(),tc.getInception().toZonedDateTime(zoneId),tc.getExpiration().toZonedDateTime(zoneId),tc.getMaxTickets(),tc.isTokenGenerationRequested(),price,StringUtils.trimToNull(tc.getCode()),DateTimeModification.toZonedDateTime(tc.getValidCheckInFrom(),zoneId),DateTimeModification.toZonedDateTime(tc.getValidCheckInTo(),(zoneId)));
  TicketCategory updated=ticketCategoryRepository.getByIdAndActive(tc.getId(),eventId);
  int addedTickets=0;
  if (original.isBounded() ^ tc.isBounded()) {
    handleTicketAllocationStrategyChange(event,original,tc);
  }
 else {
    addedTickets=updated.getMaxTickets() - original.getMaxTickets();
    handleTicketNumberModification(event,original,updated,addedTickets,resetTicketsToFree);
  }
  handleTokenModification(original,updated,addedTickets);
  handlePriceChange(event,original,updated);
  insertOrUpdateTicketCategoryDescription(tc.getId(),tc,event);
  auditingRepository.insertUpdateTicketInCategoryId(tc.getId());
}
Program: 164534
Project: 164534
Buggy source:
public void updateAdditionalField(int id,EventModification.UpdateAdditionalField f){
  String serializedRestrictedValues=toSerializedRestrictedValues(f);
  ticketFieldRepository.updateRequiredAndRestrictedValues(id,f.isRequired(),serializedRestrictedValues);
  f.getDescription().forEach((locale,value) -> {
    String val=Json.GSON.toJson(value.getDescription());
    if (0 == ticketFieldRepository.updateDescription(id,locale,val)) {
      ticketFieldRepository.insertDescription(id,locale,val);
    }
    ;
  }
);
}

Fixed version (ground truth):
public void updateAdditionalField(int id,EventModification.UpdateAdditionalField f){
  String serializedRestrictedValues=toSerializedRestrictedValues(f);
  ticketFieldRepository.updateRequiredAndRestrictedValues(id,f.isRequired(),serializedRestrictedValues);
  f.getDescription().forEach((locale,value) -> {
    String val=Json.GSON.toJson(value.getDescription());
    if (0 == ticketFieldRepository.updateDescription(id,locale,val)) {
      ticketFieldRepository.insertDescription(id,locale,val);
    }
  }
);
}
Program: 164535
Project: 164535
Buggy source:
@Test public void testUpdateBoundedCategory(){
  List<TicketCategoryModification> categories=Collections.singletonList(new TicketCategoryModification(null,"String_Node_Str",10,new DateTimeModification(LocalDate.now(),LocalTime.now()),new DateTimeModification(LocalDate.now(),LocalTime.now()),DESCRIPTION,BigDecimal.TEN,false,"String_Node_Str",false,null,null,null));
  Pair<Event,String> pair=initEvent(categories,organizationRepository,userManager,eventManager,eventRepository);
  Event event=pair.getKey();
  TicketCategory category=ticketCategoryRepository.findByEventId(event.getId()).get(0);
  TicketCategoryModification tcm=new TicketCategoryModification(category.getId(),"String_Node_Str",20,new DateTimeModification(LocalDate.now(),LocalTime.now()),new DateTimeModification(LocalDate.now(),LocalTime.now()),DESCRIPTION,BigDecimal.TEN,false,"String_Node_Str",false,null,null,null);
  eventManager.updateCategory(category.getId(),event.getId(),tcm,pair.getValue());
  List<Ticket> tickets=ticketRepository.findFreeByEventId(event.getId());
  assertNotNull(tickets);
  assertFalse(tickets.isEmpty());
  assertEquals(AVAILABLE_SEATS,tickets.size());
  assertEquals(0,tickets.stream().filter(t -> t.getCategoryId() == null).count());
}

Fixed version (ground truth):
@Test public void testUpdateBoundedCategory(){
  List<TicketCategoryModification> categories=Collections.singletonList(new TicketCategoryModification(null,"String_Node_Str",10,new DateTimeModification(LocalDate.now(),LocalTime.now()),new DateTimeModification(LocalDate.now(),LocalTime.now()),DESCRIPTION,BigDecimal.TEN,false,"String_Node_Str",false,null,null,null));
  Pair<Event,String> pair=initEvent(categories,organizationRepository,userManager,eventManager,eventRepository);
  Event event=pair.getKey();
  TicketCategory category=ticketCategoryRepository.findByEventId(event.getId()).get(0);
  TicketCategoryModification tcm=new TicketCategoryModification(category.getId(),"String_Node_Str",20,new DateTimeModification(LocalDate.now(),LocalTime.now()),new DateTimeModification(LocalDate.now(),LocalTime.now()),DESCRIPTION,BigDecimal.TEN,false,"String_Node_Str",false,null,null,null);
  eventManager.updateCategory(category.getId(),event.getId(),tcm,pair.getValue());
  waitingQueueSubscriptionProcessor.distributeAvailableSeats(event);
  List<Ticket> tickets=ticketRepository.findFreeByEventId(event.getId());
  assertNotNull(tickets);
  assertFalse(tickets.isEmpty());
  assertEquals(AVAILABLE_SEATS,tickets.size());
  assertEquals(0,tickets.stream().filter(t -> t.getCategoryId() == null).count());
}
Program: 164536
Project: 164536
Buggy source:
private boolean send(int eventId,String address,String apiKey,String email,CustomerName name,String language,String eventKey){
}

Fixed version (ground truth):
private boolean send(int eventId,String address,String apiKey,String email,CustomerName name,String language,String eventKey){
  Map<String,Object> content=new HashMap<>();
  content.put("String_Node_Str",email);
  content.put("String_Node_Str","String_Node_Str");
  Map<String,String> mergeFields=new HashMap<>();
  mergeFields.put("String_Node_Str",name.isHasFirstAndLastName() ? name.getFirstName() : name.getFullName());
  mergeFields.put(ALFIO_EVENT_KEY,eventKey);
  content.put("String_Node_Str",mergeFields);
  content.put("String_Node_Str",language);
  Request request=new Request.Builder().url(address).header("String_Node_Str",Credentials.basic("String_Node_Str",apiKey)).put(RequestBody.create(MediaType.parse(APPLICATION_JSON),Json.GSON.toJson(content,Map.class))).build();
  try {
    Response response=httpClient.newCall(request).execute();
    if (response.isSuccessful()) {
      pluginDataStorage.registerSuccess(String.format("String_Node_Str",email),eventId);
      return true;
    }
    try (ResponseBody body=response.body()){
      String responseBody=body.string();
      if (response.code() != 400 || responseBody.contains("String_Node_Str")) {
        pluginDataStorage.registerFailure(String.format(FAILURE_MSG,email,name,language,responseBody),eventId);
        return false;
      }
 else {
        pluginDataStorage.registerWarning(String.format(FAILURE_MSG,email,name,language,responseBody),eventId);
      }
      return true;
    }
   }
 catch (  IOException e) {
    pluginDataStorage.registerFailure(String.format(FAILURE_MSG,email,name,language,e.toString()),eventId);
    return false;
  }
}
Program: 164541
Project: 164541
Buggy source:
private Result<Pair<TicketReservation,List<Ticket>>> processReservation(AdminReservationModification input,String username,Event event){
  return input.getTicketsInfo().stream().map(ti -> checkCategoryCapacity(ti,event,input,username).map(c -> Pair.of(ti,c))).map(t -> createReservation(t,event,input)).reduce((r1,r2) -> {
    boolean successful=r1.isSuccess() && r2.isSuccess();
    ResultStatus global=r1.isSuccess() ? r2.getStatus() : r1.getStatus();
    List<ErrorCode> errors=new ArrayList<>();
    if (!successful) {
      errors.addAll(r1.getErrors());
      errors.addAll(r2.getErrors());
    }
    return new Result<>(global,joinData(r1,r2),errors);
  }
).orElseGet(() -> Result.error(singletonList(ErrorCode.custom("String_Node_Str","String_Node_Str"))));
}

Fixed version (ground truth):
private Result<Pair<TicketReservation,List<Ticket>>> processReservation(AdminReservationModification input,String username,Event event){
  return input.getTicketsInfo().stream().map(ti -> checkCategoryCapacity(ti,event,input,username)).reduce((r1,r2) -> reduceResults(r1,r2,this::joinData)).map(r -> createReservation(r,event,input)).orElseGet(() -> Result.error(singletonList(ErrorCode.custom("String_Node_Str","String_Node_Str"))));
}
Program: 164542
Project: 164542
Buggy source:
private Result<TicketCategory> checkCategoryCapacity(TicketsInfo ti,Event event,AdminReservationModification reservation,String username){
  return ti.getCategory().isExisting() ? checkExistingCategory(ti,event,username) : createCategory(ti,event,reservation,username);
}

Fixed version (ground truth):
private Result<List<TicketsInfo>> checkCategoryCapacity(TicketsInfo ti,Event event,AdminReservationModification reservation,String username){
  Result<TicketCategory> ticketCategoryResult=ti.getCategory().isExisting() ? checkExistingCategory(ti,event,username) : createCategory(ti,event,reservation,username);
  return ticketCategoryResult.map(tc -> Collections.singletonList(new TicketsInfo(new Category(tc.getId(),tc.getName(),tc.getPrice()),ti.getAttendees(),ti.isAddSeatsIfNotAvailable(),ti.isUpdateAttendees())));
}
Program: 164543
Project: 164543
Buggy source:
private Result<TicketCategory> checkExistingCategory(TicketsInfo ti,Event event,String username){
  AdminReservationModification.Category category=ti.getCategory();
  List<Attendee> attendees=ti.getAttendees();
  int tickets=attendees.size();
  int eventId=event.getId();
  TicketCategory existing=ticketCategoryRepository.getById(category.getExistingCategoryId(),eventId);
  int existingCategoryId=existing.getId();
  int freeTicketsInCategory=ticketRepository.countFreeTickets(eventId,existingCategoryId);
  int notAllocated=getNotAllocatedTickets(event);
  int missingTickets=Math.max(tickets - (freeTicketsInCategory + notAllocated),0);
  Event modified=increaseSeatsIfNeeded(ti,event,missingTickets,event);
  if (freeTicketsInCategory < tickets && existing.isBounded()) {
    int maxTickets=existing.getMaxTickets() + (tickets - freeTicketsInCategory);
    TicketCategoryModification tcm=new TicketCategoryModification(existingCategoryId,existing.getName(),maxTickets,DateTimeModification.fromZonedDateTime(existing.getInception(modified.getZoneId())),DateTimeModification.fromZonedDateTime(existing.getExpiration(event.getZoneId())),Collections.emptyMap(),existing.getPrice(),existing.isAccessRestricted(),"String_Node_Str",true);
    return eventManager.updateCategory(existingCategoryId,modified,tcm,username);
  }
  return Result.success(existing);
}

Fixed version (ground truth):
private Result<TicketCategory> checkExistingCategory(TicketsInfo ti,Event event,String username){
  Category category=ti.getCategory();
  List<Attendee> attendees=ti.getAttendees();
  int tickets=attendees.size();
  int eventId=event.getId();
  TicketCategory existing=ticketCategoryRepository.getById(category.getExistingCategoryId(),eventId);
  int existingCategoryId=existing.getId();
  int freeTicketsInCategory=ticketRepository.countFreeTickets(eventId,existingCategoryId);
  int notAllocated=getNotAllocatedTickets(event);
  int missingTickets=Math.max(tickets - (freeTicketsInCategory + notAllocated),0);
  Event modified=increaseSeatsIfNeeded(ti,event,missingTickets,event);
  if (freeTicketsInCategory < tickets && existing.isBounded()) {
    int maxTickets=existing.getMaxTickets() + (tickets - freeTicketsInCategory);
    TicketCategoryModification tcm=new TicketCategoryModification(existingCategoryId,existing.getName(),maxTickets,DateTimeModification.fromZonedDateTime(existing.getInception(modified.getZoneId())),DateTimeModification.fromZonedDateTime(existing.getExpiration(event.getZoneId())),Collections.emptyMap(),existing.getPrice(),existing.isAccessRestricted(),"String_Node_Str",true);
    return eventManager.updateCategory(existingCategoryId,modified,tcm,username);
  }
  return Result.success(existing);
}
Program: 164544
Project: 164544
Buggy source:
private Result<TicketCategory> createCategory(TicketsInfo ti,Event event,AdminReservationModification reservation,String username){
  AdminReservationModification.Category category=ti.getCategory();
  List<Attendee> attendees=ti.getAttendees();
  DateTimeModification inception=DateTimeModification.fromZonedDateTime(ZonedDateTime.now(event.getZoneId()));
  int tickets=attendees.size();
  TicketCategoryModification tcm=new TicketCategoryModification(category.getExistingCategoryId(),category.getName(),tickets,inception,reservation.getExpiration(),Collections.emptyMap(),category.getPrice(),true,"String_Node_Str",true);
  int notAllocated=getNotAllocatedTickets(event);
  int missingTickets=Math.max(tickets - notAllocated,0);
  Event modified=increaseSeatsIfNeeded(ti,event,missingTickets,event);
  return eventManager.insertCategory(modified,tcm,username).map(id -> ticketCategoryRepository.getById(id,event.getId()));
}

Fixed version (ground truth):
private Result<TicketCategory> createCategory(TicketsInfo ti,Event event,AdminReservationModification reservation,String username){
  Category category=ti.getCategory();
  List<Attendee> attendees=ti.getAttendees();
  DateTimeModification inception=DateTimeModification.fromZonedDateTime(ZonedDateTime.now(event.getZoneId()));
  int tickets=attendees.size();
  TicketCategoryModification tcm=new TicketCategoryModification(category.getExistingCategoryId(),category.getName(),tickets,inception,reservation.getExpiration(),Collections.emptyMap(),category.getPrice(),true,"String_Node_Str",true);
  int notAllocated=getNotAllocatedTickets(event);
  int missingTickets=Math.max(tickets - notAllocated,0);
  Event modified=increaseSeatsIfNeeded(ti,event,missingTickets,event);
  return eventManager.insertCategory(modified,tcm,username).map(id -> ticketCategoryRepository.getById(id,event.getId()));
}
Program: 164545
Project: 164545
Buggy source:
private Pair<TicketReservation,List<Ticket>> joinData(Result<Pair<TicketReservation,List<Ticket>>> t1,Result<Pair<TicketReservation,List<Ticket>>> t2){
  if (!t1.isSuccess() || !t2.isSuccess()) {
    return null;
  }
  List<Ticket> tickets=new ArrayList<>();
  Pair<TicketReservation,List<Ticket>> data1=t1.getData();
  tickets.addAll(data1.getRight());
  Pair<TicketReservation,List<Ticket>> data2=t2.getData();
  tickets.addAll(data2.getRight());
  return Pair.of(data1.getLeft(),tickets);
}

Fixed version (ground truth):
private List<TicketsInfo> joinData(List<TicketsInfo> t1,List<TicketsInfo> t2){
  List<TicketsInfo> join=new ArrayList<>();
  join.addAll(t1);
  join.addAll(t2);
  return join;
}
Program: 164547
Project: 164547
Buggy source:
@RequestMapping(value="String_Node_Str",method=GET) public List<EventWithStatistics> getAllEvents(Principal principal){
  return eventStatisticsManager.getAllEventsWithStatistics(principal.getName()).stream().sorted().collect(Collectors.toList());
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=GET) public List<EventStatistic> getAllEvents(Principal principal){
  return eventStatisticsManager.getAllEventsWithStatistics(principal.getName()).stream().map(EventStatistic::new).sorted().collect(Collectors.toList());
}
Program: 164548
Project: 164548
Buggy source:
private void deleteReservations(List<String> reservationIdsToRemove){
  int removedReservation=ticketReservationRepository.remove(reservationIdsToRemove);
  Validate.isTrue(removedReservation == 1,"String_Node_Str" + removedReservation);
}

Fixed version (ground truth):
private void deleteReservations(List<String> reservationIdsToRemove){
  waitingQueueManager.cleanExpiredReservations(reservationIdsToRemove);
  int removedReservation=ticketReservationRepository.remove(reservationIdsToRemove);
  Validate.isTrue(removedReservation == 1,"String_Node_Str" + removedReservation);
}
Program: 164549
Project: 164549
Buggy source:
@Bean public EmbeddedServletContainerCustomizer embeddedServletContainerCustomizer(){
  return (container) -> {
    container.addInitializers(SERVLET_CONTEXT_INITIALIZER);
    Map<String,String> mimeMappings=new HashMap<>();
    mimeMappings.put("String_Node_Str","String_Node_Str");
    mimeMappings.put("String_Node_Str","String_Node_Str");
    mimeMappings.put("String_Node_Str","String_Node_Str");
    mimeMappings.put("String_Node_Str","String_Node_Str");
    mimeMappings.put("String_Node_Str","String_Node_Str");
    container.setSessionTimeout(2,TimeUnit.HOURS);
    container.setMimeMappings(new MimeMappings(mimeMappings));
  }
;
}

Fixed version (ground truth):
@Bean public EmbeddedServletContainerCustomizer embeddedServletContainerCustomizer(){
  return (container) -> {
    container.addInitializers(SERVLET_CONTEXT_INITIALIZER);
    Map<String,String> mimeMappings=new HashMap<>();
    mimeMappings.put("String_Node_Str","String_Node_Str");
    mimeMappings.put("String_Node_Str","String_Node_Str");
    mimeMappings.put("String_Node_Str","String_Node_Str");
    mimeMappings.put("String_Node_Str","String_Node_Str");
    mimeMappings.put("String_Node_Str","String_Node_Str");
    container.setSessionTimeout(2,TimeUnit.HOURS);
    container.setMimeMappings(new MimeMappings(mimeMappings));
    container.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND,"String_Node_Str"),new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"String_Node_Str"),new ErrorPage("String_Node_Str"));
  }
;
}
Program: 164550
Project: 164550
Buggy source:
@Query("String_Node_Str") List<Integer> selectFreeTicketsForPreReservation(@Bind("String_Node_Str") int eventId,@Bind("String_Node_Str") int amount);

Fixed version (ground truth):
@Query("String_Node_Str") List<Integer> selectFreeTicketsForPreReservation(@Bind("String_Node_Str") int eventId,@Bind("String_Node_Str") int amount,@Bind("String_Node_Str") int categoryId);
Program: 164551
Project: 164551
Buggy source:
@Override public Supplier<List<Pair<Integer,Integer>>> supplier(){
  return ArrayList::new;
}

Fixed version (ground truth):
@Override public Supplier<List<Pair<Integer,TicketCategoryWithStatistic>>> supplier(){
  return ArrayList::new;
}
Program: 164552
Project: 164552
Buggy source:
@Override public Function<List<Pair<Integer,Integer>>,List<Pair<Integer,Integer>>> finisher(){
  return Function.identity();
}

Fixed version (ground truth):
@Override public Function<List<Pair<Integer,TicketCategoryWithStatistic>>,List<Pair<Integer,TicketCategoryWithStatistic>>> finisher(){
  return Function.identity();
}
Program: 164553
Project: 164553
Buggy source:
@Override public BiConsumer<List<Pair<Integer,Integer>>,Pair<Integer,TicketCategoryWithStatistic>> accumulator(){
  return (accumulator,candidate) -> {
    int requested=requestedTickets.get();
    if (requested > 0) {
      int capacity=Math.min(requested,candidate.getKey());
      accumulator.add(Pair.of(capacity,candidate.getValue().getId()));
      requestedTickets.addAndGet(-capacity);
    }
  }
;
}

Fixed version (ground truth):
@Override public BiConsumer<List<Pair<Integer,TicketCategoryWithStatistic>>,Pair<Integer,TicketCategoryWithStatistic>> accumulator(){
  return (accumulator,candidate) -> {
    int requested=requestedTickets.get();
    if (requested > 0) {
      int capacity=Math.min(requested,candidate.getKey());
      accumulator.add(Pair.of(capacity,candidate.getValue()));
      requestedTickets.addAndGet(-capacity);
    }
  }
;
}
Program: 164554
Project: 164554
Buggy source:
/** 
 * This collector is not designed run in parallel. Thus the combiner here doesn't do nothing
 * @return the first parameter
 */
@Override public BinaryOperator<List<Pair<Integer,Integer>>> combiner(){
  return (a,b) -> a;
}

Fixed version (ground truth):
/** 
 * This collector is not designed run in parallel. Thus the combiner here doesn't do nothing
 * @return the first parameter
 */
@Override public BinaryOperator<List<Pair<Integer,TicketCategoryWithStatistic>>> combiner(){
  return (a,b) -> a;
}
Program: 164556
Project: 164556
Buggy source:
@BeforeClass public static void initEnv(){
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass public static void initEnv(){
  IntegrationTestUtil.initSystemProperties();
}
Program: 164557
Project: 164557
Buggy source:
@BeforeClass public static void initEnv(){
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass public static void initEnv(){
  IntegrationTestUtil.initSystemProperties();
}
Program: 164559
Project: 164559
Buggy source:
private void cancelReservation(String reservationId){
  List<String> reservationIdsToRemove=singletonList(reservationId);
  specialPriceRepository.updateStatusForReservation(reservationIdsToRemove,Status.FREE.toString());
  int updatedTickets=ticketRepository.freeFromReservation(reservationIdsToRemove);
  Validate.isTrue(updatedTickets > 0,"String_Node_Str");
  deleteReservations(reservationIdsToRemove);
  waitingQueueManager.fireReservationExpired(reservationId);
}

Fixed version (ground truth):
private void cancelReservation(String reservationId){
  List<String> reservationIdsToRemove=singletonList(reservationId);
  specialPriceRepository.updateStatusForReservation(reservationIdsToRemove,Status.FREE.toString());
  int updatedTickets=ticketRepository.freeFromReservation(reservationIdsToRemove);
  Validate.isTrue(updatedTickets > 0,"String_Node_Str");
  waitingQueueManager.fireReservationExpired(reservationId);
  deleteReservations(reservationIdsToRemove);
}
Program: 164560
Project: 164560
Buggy source:
public void fireReservationExpired(String reservationId){
  updateStatus(reservationId,WaitingQueueSubscription.Status.EXPIRED.toString());
}

Fixed version (ground truth):
public void fireReservationExpired(String reservationId){
  waitingQueueRepository.bulkUpdateExpiredReservations(Collections.singletonList(reservationId));
}
Program: 164561
Project: 164561
Buggy source:
@Autowired public EventController(ConfigurationManager configurationManager,EventRepository eventRepository,EventDescriptionRepository eventDescriptionRepository,I18nManager i18nManager,OrganizationRepository organizationRepository,TicketCategoryRepository ticketCategoryRepository,TicketCategoryDescriptionRepository ticketCategoryDescriptionRepository,SpecialPriceRepository specialPriceRepository,PromoCodeDiscountRepository promoCodeRepository,EventManager eventManager,TicketReservationManager ticketReservationManager){
  this.configurationManager=configurationManager;
  this.eventRepository=eventRepository;
  this.eventDescriptionRepository=eventDescriptionRepository;
  this.i18nManager=i18nManager;
  this.organizationRepository=organizationRepository;
  this.ticketCategoryRepository=ticketCategoryRepository;
  this.ticketCategoryDescriptionRepository=ticketCategoryDescriptionRepository;
  this.specialPriceRepository=specialPriceRepository;
  this.promoCodeRepository=promoCodeRepository;
  this.eventManager=eventManager;
  this.ticketReservationManager=ticketReservationManager;
}

Fixed version (ground truth):
@Autowired public EventController(ConfigurationManager configurationManager,EventRepository eventRepository,EventDescriptionRepository eventDescriptionRepository,I18nManager i18nManager,OrganizationRepository organizationRepository,TicketCategoryRepository ticketCategoryRepository,TicketCategoryDescriptionRepository ticketCategoryDescriptionRepository,SpecialPriceRepository specialPriceRepository,PromoCodeDiscountRepository promoCodeRepository,EventManager eventManager,TicketReservationManager ticketReservationManager,EventStatisticsManager eventStatisticsManager){
  this.configurationManager=configurationManager;
  this.eventRepository=eventRepository;
  this.eventDescriptionRepository=eventDescriptionRepository;
  this.i18nManager=i18nManager;
  this.organizationRepository=organizationRepository;
  this.ticketCategoryRepository=ticketCategoryRepository;
  this.ticketCategoryDescriptionRepository=ticketCategoryDescriptionRepository;
  this.specialPriceRepository=specialPriceRepository;
  this.promoCodeRepository=promoCodeRepository;
  this.eventManager=eventManager;
  this.ticketReservationManager=ticketReservationManager;
  this.eventStatisticsManager=eventStatisticsManager;
}
Program: 164563
Project: 164563
Buggy source:
private void validateSubscriptionType(Event event,WaitingQueueSubscription.Type type){
  if (type == WaitingQueueSubscription.Type.PRE_SALES) {
    Validate.isTrue(configurationManager.getBooleanConfigValue(Configuration.enablePreRegistration(event),false),"String_Node_Str");
  }
 else {
    EventWithStatistics eventWithStatistics=eventStatisticsManager.fillWithStatistics(event);
    Validate.isTrue(eventWithStatistics.getTicketCategories().stream().allMatch(tc -> determineAvailableSeats(tc,eventWithStatistics) == 0),"String_Node_Str");
  }
}

Fixed version (ground truth):
private void validateSubscriptionType(Event event,WaitingQueueSubscription.Type type){
  if (type == WaitingQueueSubscription.Type.PRE_SALES) {
    Validate.isTrue(configurationManager.getBooleanConfigValue(Configuration.enablePreRegistration(event),false),"String_Node_Str");
  }
 else {
    Validate.isTrue(eventStatisticsManager.noSeatsAvailable().test(event),"String_Node_Str");
  }
}
Program: 164564
Project: 164564
Buggy source:
public static boolean displayWaitingQueueForm(Event event,List<SaleableTicketCategory> categories,ConfigurationManager configurationManager){
  Optional<SaleableTicketCategory> lastCategoryOptional=findLastCategory(categories);
  if (!lastCategoryOptional.isPresent()) {
    return false;
  }
  ZonedDateTime now=ZonedDateTime.now(event.getZoneId());
  SaleableTicketCategory lastCategory=lastCategoryOptional.get();
  if (isPreSales(event,categories)) {
    return configurationManager.getBooleanConfigValue(Configuration.enablePreRegistration(event),false);
  }
 else   if (configurationManager.getBooleanConfigValue(Configuration.enableWaitingQueue(event),false)) {
    return now.isBefore(lastCategory.getZonedExpiration()) && noTicketAvailable(categories);
  }
  return false;
}

Fixed version (ground truth):
public static boolean displayWaitingQueueForm(Event event,List<SaleableTicketCategory> categories,ConfigurationManager configurationManager,Predicate<Event> noTicketsAvailable){
  Optional<SaleableTicketCategory> lastCategoryOptional=findLastCategory(categories);
  if (!lastCategoryOptional.isPresent()) {
    return false;
  }
  ZonedDateTime now=ZonedDateTime.now(event.getZoneId());
  if (isPreSales(event,categories)) {
    return configurationManager.getBooleanConfigValue(Configuration.enablePreRegistration(event),false);
  }
 else   if (configurationManager.getBooleanConfigValue(Configuration.enableWaitingQueue(event),false)) {
    return now.isBefore(lastCategoryOptional.get().getZonedExpiration()) && noTicketsAvailable.test(event);
  }
  return false;
}
Program: 164565
Project: 164565
Buggy source:
public String renderString(String template,Map<String,Object> model,Locale locale,TemplateOutput templateOutput){
  return render(new ByteArrayResource(template.getBytes()),"String_Node_Str",model,locale,templateOutput,false);
}

Fixed version (ground truth):
public String renderString(String template,Map<String,Object> model,Locale locale,TemplateOutput templateOutput){
  return render(new ByteArrayResource(template.getBytes(StandardCharsets.UTF_8)),"String_Node_Str",model,locale,templateOutput,false);
}
Program: 164566
Project: 164566
Buggy source:
@Transactional public UserWithPassword resetPassword(int userId){
  User user=findUser(userId);
  String password=PasswordGenerator.generateRandomPassword();
  Validate.isTrue(userRepository.resetPassword(userId,password) == 1,"String_Node_Str");
  return new UserWithPassword(user,password,UUID.randomUUID().toString());
}

Fixed version (ground truth):
@Transactional public UserWithPassword resetPassword(int userId){
  User user=findUser(userId);
  String password=PasswordGenerator.generateRandomPassword();
  Validate.isTrue(userRepository.resetPassword(userId,passwordEncoder.encode(password)) == 1,"String_Node_Str");
  return new UserWithPassword(user,password,UUID.randomUUID().toString());
}
Program: 164567
Project: 164567
Buggy source:
private HandlerInterceptor getCSPInterceptor(){
  return new HandlerInterceptorAdapter(){
    @Override public void postHandle(    HttpServletRequest request,    HttpServletResponse response,    Object handler,    ModelAndView modelAndView) throws Exception {
      response.addHeader("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    }
  }
;
}

Fixed version (ground truth):
private HandlerInterceptor getCSPInterceptor(){
  return new HandlerInterceptorAdapter(){
    @Override public void postHandle(    HttpServletRequest request,    HttpServletResponse response,    Object handler,    ModelAndView modelAndView) throws Exception {
      response.addHeader("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    }
  }
;
}
Program: 164568
Project: 164568
Buggy source:
private void updateTicketOwner(UpdateTicketOwnerForm updateTicketOwner,HttpServletRequest request,Ticket t,Event event,TicketReservation ticketReservation){
  ticketReservationManager.updateTicketOwner(t,RequestContextUtils.getLocale(request),event,updateTicketOwner,getConfirmationTextBuilder(request,t,event,ticketReservation),getOwnerChangeTextBuilder(request,t,event),preparePdfTicket(request,event,ticketReservation,t));
}

Fixed version (ground truth):
private void updateTicketOwner(UpdateTicketOwnerForm updateTicketOwner,HttpServletRequest request,Ticket t,Event event,TicketReservation ticketReservation){
  ticketReservationManager.updateTicketOwner(t,RequestContextUtils.getLocale(request),event,updateTicketOwner,getConfirmationTextBuilder(request,event,ticketReservation),getOwnerChangeTextBuilder(request,t,event),preparePdfTicket(request,event,ticketReservation,t));
}
Program: 164569
Project: 164569
Buggy source:
private PDFTemplateBuilder preparePdfTicket(HttpServletRequest request,Event event,TicketReservation ticketReservation,Ticket ticket){
  TicketCategory ticketCategory=ticketCategoryRepository.getById(ticket.getCategoryId(),event.getId());
  Organization organization=organizationRepository.getById(event.getOrganizationId());
  try {
    return TemplateProcessor.buildPDFTicket(request,event,ticketReservation,ticket,ticketCategory,organization,templateManager);
  }
 catch (  WriterException|IOException e) {
    throw new IllegalStateException(e);
  }
}

Fixed version (ground truth):
private PartialTicketPDFGenerator preparePdfTicket(HttpServletRequest request,Event event,TicketReservation ticketReservation,Ticket ticket){
  TicketCategory ticketCategory=ticketCategoryRepository.getById(ticket.getCategoryId(),event.getId());
  Organization organization=organizationRepository.getById(event.getOrganizationId());
  try {
    return TemplateProcessor.buildPartialPDFTicket(request,event,ticketReservation,ticketCategory,organization,templateManager);
  }
 catch (  WriterException|IOException e) {
    throw new IllegalStateException(e);
  }
}
Program: 164570
Project: 164570
Buggy source:
private TextTemplateBuilder getOwnerChangeTextBuilder(HttpServletRequest request,Ticket t,Event event){
  return TemplateProcessor.buildEmailForOwnerChange(t.getEmail(),event,t,organizationRepository,ticketReservationManager,templateManager,request);
}

Fixed version (ground truth):
private PartialTicketTextGenerator getOwnerChangeTextBuilder(HttpServletRequest request,Ticket t,Event event){
  return TemplateProcessor.buildEmailForOwnerChange(event,t,organizationRepository,ticketReservationManager,templateManager,request);
}
Program: 164571
Project: 164571
Buggy source:
private TextTemplateBuilder getConfirmationTextBuilder(HttpServletRequest request,Ticket t,Event event,TicketReservation ticketReservation){
  return TemplateProcessor.buildEmail(event,organizationRepository,ticketReservation,t,templateManager,request);
}

Fixed version (ground truth):
private PartialTicketTextGenerator getConfirmationTextBuilder(HttpServletRequest request,Event event,TicketReservation ticketReservation){
  return TemplateProcessor.buildPartialEmail(event,organizationRepository,ticketReservation,templateManager,request);
}
Program: 164572
Project: 164572
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String sendTicketByEmail(@PathVariable("String_Node_Str") String eventName,@PathVariable("String_Node_Str") String reservationId,@PathVariable("String_Node_Str") String ticketIdentifier,HttpServletRequest request,Locale locale) throws Exception {
  Optional<Triple<Event,TicketReservation,Ticket>> oData=ticketReservationManager.fetchCompleteAndAssigned(eventName,reservationId,ticketIdentifier);
  if (!oData.isPresent()) {
    return "String_Node_Str" + eventName + "String_Node_Str"+ reservationId;
  }
  Triple<Event,TicketReservation,Ticket> data=oData.get();
  Ticket ticket=data.getRight();
  Event event=data.getLeft();
  notificationManager.sendTicketByEmail(ticket,event,locale,TemplateProcessor.buildEmail(event,organizationRepository,data.getMiddle(),ticket,templateManager,request),preparePdfTicket(request,event,data.getMiddle(),ticket));
  return "String_Node_Str" + eventName + "String_Node_Str"+ reservationId+ ("String_Node_Str".equals(request.getParameter("String_Node_Str")) ? ("String_Node_Str" + ticket.getUuid()) : "String_Node_Str")+ "String_Node_Str";
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public String sendTicketByEmail(@PathVariable("String_Node_Str") String eventName,@PathVariable("String_Node_Str") String reservationId,@PathVariable("String_Node_Str") String ticketIdentifier,HttpServletRequest request,Locale locale) throws Exception {
  Optional<Triple<Event,TicketReservation,Ticket>> oData=ticketReservationManager.fetchCompleteAndAssigned(eventName,reservationId,ticketIdentifier);
  if (!oData.isPresent()) {
    return "String_Node_Str" + eventName + "String_Node_Str"+ reservationId;
  }
  Triple<Event,TicketReservation,Ticket> data=oData.get();
  Ticket ticket=data.getRight();
  Event event=data.getLeft();
  notificationManager.sendTicketByEmail(ticket,event,locale,TemplateProcessor.buildPartialEmail(event,organizationRepository,data.getMiddle(),templateManager,request),preparePdfTicket(request,event,data.getMiddle(),ticket));
  return "String_Node_Str" + eventName + "String_Node_Str"+ reservationId+ ("String_Node_Str".equals(request.getParameter("String_Node_Str")) ? ("String_Node_Str" + ticket.getUuid()) : "String_Node_Str")+ "String_Node_Str";
}
Program: 164573
Project: 164573
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public void generateTicketPdf(@PathVariable("String_Node_Str") String eventName,@PathVariable("String_Node_Str") String reservationId,@PathVariable("String_Node_Str") String ticketIdentifier,HttpServletRequest request,HttpServletResponse response) throws IOException, DocumentException, WriterException {
  Optional<Triple<Event,TicketReservation,Ticket>> oData=ticketReservationManager.fetchCompleteAndAssigned(eventName,reservationId,ticketIdentifier);
  if (!oData.isPresent()) {
    response.sendError(HttpServletResponse.SC_FORBIDDEN);
    return;
  }
  Triple<Event,TicketReservation,Ticket> data=oData.get();
  Ticket ticket=data.getRight();
  response.setContentType("String_Node_Str");
  response.addHeader("String_Node_Str","String_Node_Str" + ticketIdentifier + "String_Node_Str");
  try (OutputStream os=response.getOutputStream()){
    preparePdfTicket(request,data.getLeft(),data.getMiddle(),ticket).build().createPDF(os);
  }
 }

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public void generateTicketPdf(@PathVariable("String_Node_Str") String eventName,@PathVariable("String_Node_Str") String reservationId,@PathVariable("String_Node_Str") String ticketIdentifier,HttpServletRequest request,HttpServletResponse response) throws IOException, DocumentException, WriterException {
  Optional<Triple<Event,TicketReservation,Ticket>> oData=ticketReservationManager.fetchCompleteAndAssigned(eventName,reservationId,ticketIdentifier);
  if (!oData.isPresent()) {
    response.sendError(HttpServletResponse.SC_FORBIDDEN);
    return;
  }
  Triple<Event,TicketReservation,Ticket> data=oData.get();
  Ticket ticket=data.getRight();
  response.setContentType("String_Node_Str");
  response.addHeader("String_Node_Str","String_Node_Str" + ticketIdentifier + "String_Node_Str");
  try (OutputStream os=response.getOutputStream()){
    preparePdfTicket(request,data.getLeft(),data.getMiddle(),ticket).generate(ticket).createPDF(os);
  }
 }
Program: 164574
Project: 164574
Buggy source:
private PDFTemplateBuilder preparePdfTicket(HttpServletRequest request,Event event,TicketReservation ticketReservation,Ticket ticket) throws WriterException, IOException {
  TicketCategory ticketCategory=ticketCategoryRepository.getById(ticket.getCategoryId(),event.getId());
  Organization organization=organizationRepository.getById(event.getOrganizationId());
  return TemplateProcessor.buildPDFTicket(request,event,ticketReservation,ticket,ticketCategory,organization,templateManager);
}

Fixed version (ground truth):
private PartialTicketPDFGenerator preparePdfTicket(HttpServletRequest request,Event event,TicketReservation ticketReservation,Ticket ticket) throws WriterException, IOException {
  TicketCategory ticketCategory=ticketCategoryRepository.getById(ticket.getCategoryId(),event.getId());
  Organization organization=organizationRepository.getById(event.getOrganizationId());
  return TemplateProcessor.buildPartialPDFTicket(request,event,ticketReservation,ticketCategory,organization,templateManager);
}
Program: 164575
Project: 164575
Buggy source:
public static PDFTemplateBuilder buildPDFTicket(HttpServletRequest request,Event event,TicketReservation ticketReservation,Ticket ticket,TicketCategory ticketCategory,Organization organization,TemplateManager templateManager) throws WriterException, IOException {
  return () -> {
    String qrCodeText=ticket.ticketCode(event.getPrivateKey());
    Map<String,Object> model=new HashMap<>();
    model.put("String_Node_Str",ticket);
    model.put("String_Node_Str",ticketReservation);
    model.put("String_Node_Str",ticketCategory);
    model.put("String_Node_Str",event);
    model.put("String_Node_Str",organization);
    model.put("String_Node_Str","String_Node_Str" + Base64.getEncoder().encodeToString(createQRCode(qrCodeText)));
    model.put("String_Node_Str",Optional.ofNullable(ticketReservation.getPaymentMethod()).orElse(PaymentProxy.STRIPE).isDeskPaymentRequired());
    String page=templateManager.renderClassPathResource("String_Node_Str",model,RequestContextUtils.getLocale(request));
    ITextRenderer renderer=new ITextRenderer();
    renderer.setDocumentFromString(page);
    renderer.layout();
    return renderer;
  }
;
}

Fixed version (ground truth):
public static PDFTemplateGenerator buildPDFTicket(HttpServletRequest request,Event event,TicketReservation ticketReservation,Ticket ticket,TicketCategory ticketCategory,Organization organization,TemplateManager templateManager){
  return () -> {
    String qrCodeText=ticket.ticketCode(event.getPrivateKey());
    Map<String,Object> model=new HashMap<>();
    model.put("String_Node_Str",ticket);
    model.put("String_Node_Str",ticketReservation);
    model.put("String_Node_Str",ticketCategory);
    model.put("String_Node_Str",event);
    model.put("String_Node_Str",organization);
    model.put("String_Node_Str","String_Node_Str" + Base64.getEncoder().encodeToString(createQRCode(qrCodeText)));
    model.put("String_Node_Str",Optional.ofNullable(ticketReservation.getPaymentMethod()).orElse(PaymentProxy.STRIPE).isDeskPaymentRequired());
    String page=templateManager.renderClassPathResource("String_Node_Str",model,RequestContextUtils.getLocale(request));
    ITextRenderer renderer=new ITextRenderer();
    renderer.setDocumentFromString(page);
    renderer.layout();
    return renderer;
  }
;
}
Program: 164576
Project: 164576
Buggy source:
public static TextTemplateBuilder buildEmailForOwnerChange(String newEmailOwner,Event e,Ticket t,OrganizationRepository organizationRepository,TicketReservationManager ticketReservationManager,TemplateManager templateManager,HttpServletRequest request){
  return () -> {
    String eventName=e.getShortName();
    Map<String,Object> emailModel=new HashMap<>();
    emailModel.put("String_Node_Str",t);
    emailModel.put("String_Node_Str",organizationRepository.getById(e.getOrganizationId()));
    emailModel.put("String_Node_Str",eventName);
    emailModel.put("String_Node_Str",t.getEmail());
    emailModel.put("String_Node_Str",newEmailOwner);
    emailModel.put("String_Node_Str",ticketReservationManager.reservationUrl(t.getTicketsReservationId()));
    return templateManager.renderClassPathResource("String_Node_Str",emailModel,RequestContextUtils.getLocale(request));
  }
;
}

Fixed version (ground truth):
public static PartialTicketTextGenerator buildEmailForOwnerChange(Event e,Ticket oldTicket,OrganizationRepository organizationRepository,TicketReservationManager ticketReservationManager,TemplateManager templateManager,HttpServletRequest request){
  return (newTicket) -> {
    String eventName=e.getShortName();
    Map<String,Object> emailModel=new HashMap<>();
    emailModel.put("String_Node_Str",oldTicket);
    emailModel.put("String_Node_Str",organizationRepository.getById(e.getOrganizationId()));
    emailModel.put("String_Node_Str",eventName);
    emailModel.put("String_Node_Str",oldTicket.getEmail());
    emailModel.put("String_Node_Str",newTicket.getEmail());
    emailModel.put("String_Node_Str",ticketReservationManager.reservationUrl(oldTicket.getTicketsReservationId()));
    return templateManager.renderClassPathResource("String_Node_Str",emailModel,RequestContextUtils.getLocale(request));
  }
;
}
Program: 164577
Project: 164577
Buggy source:
public static TextTemplateBuilder buildEmail(Event event,OrganizationRepository organizationRepository,TicketReservation ticketReservation,Ticket ticket,TemplateManager templateManager,HttpServletRequest request){
  return (() -> {
    Map<String,Object> model=new HashMap<>();
    model.put("String_Node_Str",organizationRepository.getById(event.getOrganizationId()));
    model.put("String_Node_Str",event);
    model.put("String_Node_Str",ticketReservation);
    model.put("String_Node_Str",ticket);
    return templateManager.renderClassPathResource("String_Node_Str",model,RequestContextUtils.getLocale(request));
  }
);
}

Fixed version (ground truth):
public static TextTemplateGenerator buildEmail(Event event,OrganizationRepository organizationRepository,TicketReservation ticketReservation,Ticket ticket,TemplateManager templateManager,HttpServletRequest request){
  return (() -> {
    Map<String,Object> model=new HashMap<>();
    model.put("String_Node_Str",organizationRepository.getById(event.getOrganizationId()));
    model.put("String_Node_Str",event);
    model.put("String_Node_Str",ticketReservation);
    model.put("String_Node_Str",ticket);
    return templateManager.renderClassPathResource("String_Node_Str",model,RequestContextUtils.getLocale(request));
  }
);
}