nus-yam/ex-repair huggingface dataset:
Program: 81662
Project: 81662
Buggy source:
public CreatingWindow(JFrame window){
  this.mainWindow=window;
  this.setTitle("String_Node_Str");
  this.setSize(400,150);
  this.setLayout(null);
  this.setResizable(false);
  this.setLocationRelativeTo(this.mainWindow);
  this.setBackground(Color.WHITE);
  this.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      CreatingWindow window=(CreatingWindow)e.getSource();
      window.mainWindow.setEnabled(true);
      window.mainWindow.setVisible(true);
      window.dispose();
    }
    public void windowDeactivated(    WindowEvent e){
      mainWindow.setVisible(true);
      mainWindow.setEnabled(true);
      CreatingWindow window=(CreatingWindow)e.getSource();
      window.dispose();
    }
    public void windowActivated(    WindowEvent e){
      mainWindow.setEnabled(false);
    }
  }
);
  nameLabel=new AJLabel("String_Node_Str",Color.BLACK,10,5,380,20);
  nameLabel.setVisible(false);
  subnameLabel=new AJLabel("String_Node_Str",Color.BLACK,10,25,380,20);
  subnameLabel.setVisible(false);
  totalLabel=new AJLabel("String_Node_Str",Color.BLACK,10,45,100,20);
  totalLabel.setVisible(false);
  sizeLabel=new AJLabel("String_Node_Str",Color.BLACK,120,45,120,20);
  sizeLabel.setVisible(false);
  languageLabel=new AJLabel("String_Node_Str",Color.BLACK,250,45,120,20);
  languageLabel.setVisible(false);
  bar=new AJProgressBar(40,75,310,20,0,100);
  bar.setStringPainted(true);
  ComponentUtil.addComponents(getContentPane(),nameLabel,subnameLabel,totalLabel,sizeLabel,languageLabel,bar);
}

Fixed version (ground truth):
public CreatingWindow(JFrame window){
  this.mainWindow=window;
  this.setTitle("String_Node_Str");
  this.setSize(400,150);
  this.setLayout(null);
  this.setResizable(false);
  this.setLocationRelativeTo(this.mainWindow);
  this.setBackground(Color.WHITE);
  this.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      CreatingWindow window=(CreatingWindow)e.getSource();
      window.mainWindow.setEnabled(true);
      window.mainWindow.setVisible(true);
      window.dispose();
    }
    public void windowActivated(    WindowEvent e){
      mainWindow.setEnabled(false);
    }
  }
);
  nameLabel=new AJLabel("String_Node_Str",Color.BLACK,10,5,380,20);
  nameLabel.setVisible(false);
  subnameLabel=new AJLabel("String_Node_Str",Color.BLACK,10,25,380,20);
  subnameLabel.setVisible(false);
  totalLabel=new AJLabel("String_Node_Str",Color.BLACK,10,45,100,20);
  totalLabel.setVisible(false);
  sizeLabel=new AJLabel("String_Node_Str",Color.BLACK,120,45,120,20);
  sizeLabel.setVisible(false);
  languageLabel=new AJLabel("String_Node_Str",Color.BLACK,250,45,120,20);
  languageLabel.setVisible(false);
  bar=new AJProgressBar(40,75,310,20,0,100);
  bar.setStringPainted(true);
  ComponentUtil.addComponents(getContentPane(),nameLabel,subnameLabel,totalLabel,sizeLabel,languageLabel,bar);
}
Program: 81663
Project: 81663
Buggy source:
public DeletingWindow(JFrame window){
  this.mainWindow=window;
  this.setTitle("String_Node_Str");
  this.setSize(400,120);
  this.setLayout(null);
  this.setResizable(false);
  this.setLocationRelativeTo(this.mainWindow);
  this.setBackground(Color.WHITE);
  this.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      DeletingWindow window=(DeletingWindow)e.getSource();
      window.mainWindow.setEnabled(true);
      window.mainWindow.setVisible(true);
      window.dispose();
    }
    public void windowDeactivated(    WindowEvent e){
      mainWindow.setVisible(true);
      mainWindow.setEnabled(true);
      DeletingWindow window=(DeletingWindow)e.getSource();
      window.dispose();
    }
    public void windowActivated(    WindowEvent e){
      mainWindow.setEnabled(false);
    }
  }
);
  dataLabel=new AJLabel("String_Node_Str",Color.BLACK,160,10,80,30);
  infoLabel=new AJLabel("String_Node_Str",Color.BLACK,10,50,380,30);
  ComponentUtil.addComponents(getContentPane(),dataLabel,infoLabel);
}

Fixed version (ground truth):
public DeletingWindow(JFrame window){
  this.mainWindow=window;
  this.setTitle("String_Node_Str");
  this.setSize(400,120);
  this.setLayout(null);
  this.setResizable(false);
  this.setLocationRelativeTo(this.mainWindow);
  this.setBackground(Color.WHITE);
  this.addWindowListener(new WindowAdapter(){
    public void windowClosing(    WindowEvent e){
      DeletingWindow window=(DeletingWindow)e.getSource();
      window.mainWindow.setEnabled(true);
      window.mainWindow.setVisible(true);
      window.dispose();
    }
    public void windowActivated(    WindowEvent e){
      mainWindow.setEnabled(false);
    }
  }
);
  dataLabel=new AJLabel("String_Node_Str",Color.BLACK,160,10,80,30);
  infoLabel=new AJLabel("String_Node_Str",Color.BLACK,10,50,380,30);
  ComponentUtil.addComponents(getContentPane(),dataLabel,infoLabel);
}
Program: 81672
Project: 81672
Buggy source:
public void doWork(Window window,MouseEvent e){
  EgDownloaderWindow mainWindow=(EgDownloaderWindow)window;
  TaskingTable table=(TaskingTable)mainWindow.runningTable;
  int rowIndex=table.getSelectedRow();
  Task task=table.getTasks().get(rowIndex);
  if (TaskStatus.UNSTARTED != task.getStatus()) {
    try {
      Desktop.getDesktop().open(new File(task.getSaveDir()));
    }
 catch (    IOException e1) {
      JOptionPane.showMessageDialog(null,"String_Node_Str");
      mainWindow.tablePopupMenu.setVisible(false);
    }
  }
 else {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
  mainWindow.tablePopupMenu.setVisible(false);
}

Fixed version (ground truth):
public void doWork(Window window,MouseEvent e){
  EgDownloaderWindow mainWindow=(EgDownloaderWindow)window;
  TaskingTable table=(TaskingTable)mainWindow.runningTable;
  int rowIndex=table.getSelectedRow();
  Task task=table.getTasks().get(rowIndex);
  if (TaskStatus.UNSTARTED != task.getStatus()) {
    try {
      Desktop.getDesktop().open(new File(task.getSaveDir()));
    }
 catch (    Exception e1) {
      JOptionPane.showMessageDialog(null,"String_Node_Str");
      mainWindow.tablePopupMenu.setVisible(false);
    }
  }
 else {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
  }
  mainWindow.tablePopupMenu.setVisible(false);
}
Program: 81674
Project: 81674
Buggy source:
public List<T> query(Object id);

Fixed version (ground truth):
public List<T> query(String name,String value);
Program: 81675
Project: 81675
Buggy source:
public List<Picture> query(Object id){
  @SuppressWarnings("String_Node_Str") List<Node> nodes=dom.selectNodes("String_Node_Str" + id.toString() + "String_Node_Str");
  if (nodes != null && nodes.size() > 0) {
    List<Picture> pics=new ArrayList<Picture>();
    for (    Node node : nodes) {
      pics.add(node2Picture(node));
    }
    return pics;
  }
  return null;
}

Fixed version (ground truth):
public List<Picture> query(String name,String value){
  @SuppressWarnings("String_Node_Str") List<Node> nodes=dom.selectNodes("String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str");
  List<Picture> pics=null;
  if (nodes != null && nodes.size() > 0) {
    pics=new ArrayList<Picture>();
    for (    Node node : nodes) {
      pics.add(node2Picture(node));
    }
  }
  return pics;
}
Program: 81676
Project: 81676
Buggy source:
public List<Task> query(Object id){
  @SuppressWarnings("String_Node_Str") List<Node> nodes=dom.selectNodes("String_Node_Str" + id.toString() + "String_Node_Str");
  if (nodes != null && nodes.size() > 0) {
    List<Task> tasks=new ArrayList<Task>();
    for (    Node node : nodes) {
      tasks.add(node2Task(node));
    }
    return tasks;
  }
  return null;
}

Fixed version (ground truth):
public List<Task> query(String name,String value){
  @SuppressWarnings("String_Node_Str") List<Node> nodes=dom.selectNodes("String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str");
  List<Task> tasks=null;
  if (nodes != null && nodes.size() > 0) {
    tasks=new ArrayList<Task>();
    for (    Node node : nodes) {
      tasks.add(node2Task(node));
    }
  }
  return tasks;
}
Program: 81677
Project: 81677
Buggy source:
public String toString(){
  return "String_Node_Str" + url + "String_Node_Str"+ name+ "String_Node_Str"+ saveDir+ "String_Node_Str"+ createTime+ "String_Node_Str"+ completedTime+ "String_Node_Str"+ total+ "String_Node_Str"+ current+ "String_Node_Str"+ size+ "String_Node_Str"+ status+ "String_Node_Str"+ pictures+ "String_Node_Str";
}

Fixed version (ground truth):
public String toString(){
  return "String_Node_Str" + id + "String_Node_Str"+ url+ "String_Node_Str"+ name+ "String_Node_Str"+ saveDir+ "String_Node_Str"+ createTime+ "String_Node_Str"+ completedTime+ "String_Node_Str"+ total+ "String_Node_Str"+ current+ "String_Node_Str"+ size+ "String_Node_Str"+ status+ "String_Node_Str"+ downloadWorker+ "String_Node_Str"+ pictures+ "String_Node_Str";
}
Program: 81678
Project: 81678
Buggy source:
public static void main(String[] args){
  for (int i=0; i < FontConst.DEFAULT_FONT.length; i++)   UIManager.put(FontConst.DEFAULT_FONT[i],new Font("String_Node_Str",Font.BOLD,12));
  try {
    BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
    BeautyEyeLNFHelper.launchBeautyEyeLNF();
    UIManager.put("String_Node_Str",false);
  }
 catch (  Exception e) {
  }
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      new InitWindow();
    }
  }
);
}

Fixed version (ground truth):
public static void main(String[] args){
  for (int i=0; i < FontConst.DEFAULT_FONT.length; i++)   UIManager.put(FontConst.DEFAULT_FONT[i],new Font("String_Node_Str",Font.BOLD,12));
  try {
    BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
    BeautyEyeLNFHelper.launchBeautyEyeLNF();
    UIManager.put("String_Node_Str",false);
  }
 catch (  Exception e) {
  }
  new InitWindow();
}
Program: 81679
Project: 81679
Buggy source:
public InitWindow(){
  super(Version.NAME + "String_Node_Str");
  this.setSize(300,100);
  this.setResizable(false);
  this.setLocationRelativeTo(null);
  this.setUndecorated(true);
  this.getContentPane().setLayout(null);
  this.setDefaultCloseOperation(EXIT_ON_CLOSE);
  textLabel=new AJLabel("String_Node_Str",new Color(123,23,89),0,10,300,30);
  textLabel.setHorizontalAlignment(JLabel.CENTER);
  this.getContentPane().add(textLabel);
  this.setVisible(true);
  textLabel.setForeground(new Color(123,23,89));
  textLabel.setText("String_Node_Str");
  File data_path=new File(ComponentConst.DATA_PATH);
  if (!data_path.exists()) {
    data_path.mkdirs();
  }
  List<Setting> settings=Db4oTemplate.query(Setting.class,ComponentConst.SETTING_DATA_PATH);
  Setting setting=settings.size() > 0 ? settings.get(0) : new Setting();
  textLabel.setForeground(new Color(123,23,89));
  textLabel.setText("String_Node_Str");
  DbTemplate<Task> taskDbTemplate=new TaskDom4jDbTemplate();
  DbTemplate<Picture> pictureDbTemplate=new PictureDom4jDbTemplate();
  List<Task> tasks=taskDbTemplate.query();
  if (tasks != null) {
    for (    Task task : tasks) {
      task.pictures=pictureDbTemplate.query();
    }
  }
  JFrame egDownloaderWindow=new EgDownloaderWindow(setting,tasks,taskDbTemplate,pictureDbTemplate);
  textLabel.setText("String_Node_Str");
  egDownloaderWindow.setVisible(true);
  this.dispose();
}

Fixed version (ground truth):
public InitWindow(){
  super(Version.NAME + "String_Node_Str");
  this.setSize(300,100);
  this.setResizable(false);
  this.setLocationRelativeTo(null);
  this.setUndecorated(true);
  this.getContentPane().setLayout(null);
  this.setDefaultCloseOperation(EXIT_ON_CLOSE);
  textLabel=new AJLabel("String_Node_Str",new Color(123,23,89),0,10,300,30);
  textLabel.setHorizontalAlignment(JLabel.CENTER);
  this.getContentPane().add(textLabel);
  this.setVisible(true);
  textLabel.setForeground(new Color(123,23,89));
  textLabel.setText("String_Node_Str");
  File data_path=new File(ComponentConst.DATA_PATH);
  if (!data_path.exists()) {
    data_path.mkdirs();
  }
  List<Setting> settings=Db4oTemplate.query(Setting.class,ComponentConst.SETTING_DATA_PATH);
  Setting setting=settings.size() > 0 ? settings.get(0) : new Setting();
  textLabel.setForeground(new Color(123,23,89));
  textLabel.setText("String_Node_Str");
  DbTemplate<Task> taskDbTemplate=new TaskDom4jDbTemplate();
  DbTemplate<Picture> pictureDbTemplate=new PictureDom4jDbTemplate();
  List<Task> tasks=taskDbTemplate.query();
  if (tasks != null) {
    for (    Task task : tasks) {
      task.pictures=pictureDbTemplate.query("String_Node_Str",task.getId());
    }
  }
  JFrame egDownloaderWindow=new EgDownloaderWindow(setting,tasks,taskDbTemplate,pictureDbTemplate);
  textLabel.setText("String_Node_Str");
  egDownloaderWindow.setVisible(true);
  this.dispose();
}
Program: 81680
Project: 81680
Buggy source:
public void doWork(Window window,MouseEvent e){
  EgDownloaderWindow mainWindow=(EgDownloaderWindow)window;
  TaskingTable table=(TaskingTable)mainWindow.runningTable;
  int[] rows=table.getSelectedRows();
  if (rows.length == 0) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
    return;
  }
  int option=JOptionPane.showConfirmDialog(null,"String_Node_Str" + (rows.length > 1 ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
  if (option == 0) {
    Task task;
    for (int i=0; i < rows.length; i++) {
      if (table.getTasks().size() >= (rows[i] - i)) {
        task=table.getTasks().get(rows[i] - i);
        System.out.println("String_Node_Str" + task.getName());
        if (task.pictures != null && task.pictures.size() > 0) {
          for (          Picture pic : task.pictures) {
            mainWindow.pictureDbTemplate.delete(pic);
          }
        }
        mainWindow.taskDbTemplate.delete(task);
        table.getTasks().remove(rows[i] - i);
      }
    }
    table.clearSelection();
    table.updateUI();
    if (table.getTasks().size() == 0) {
      mainWindow.tablePane.setVisible(false);
      mainWindow.emptyTableTips.setVisible(true);
    }
    mainWindow.setVisible(true);
  }
}

Fixed version (ground truth):
public void doWork(Window window,MouseEvent e){
  EgDownloaderWindow mainWindow=(EgDownloaderWindow)window;
  TaskingTable table=(TaskingTable)mainWindow.runningTable;
  int[] rows=table.getSelectedRows();
  if (rows.length == 0) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
    return;
  }
  int option=JOptionPane.showConfirmDialog(null,"String_Node_Str" + (rows.length > 1 ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
  if (option == 0) {
    Task task;
    for (int i=0; i < rows.length; i++) {
      if (table.getTasks().size() >= (rows[i] - i)) {
        task=table.getTasks().get(rows[i] - i);
        if (task.pictures != null && task.pictures.size() > 0) {
          for (          Picture pic : task.pictures) {
            mainWindow.pictureDbTemplate.delete(pic);
          }
        }
        mainWindow.taskDbTemplate.delete(task);
        table.getTasks().remove(rows[i] - i);
      }
    }
    table.clearSelection();
    table.updateUI();
    if (table.getTasks().size() == 0) {
      mainWindow.tablePane.setVisible(false);
      mainWindow.emptyTableTips.setVisible(true);
    }
    mainWindow.setVisible(true);
  }
}
Program: 81682
Project: 81682
Buggy source:
protected Void doInBackground() throws Exception {
  task.setStatus(TaskStatus.STARTED);
  List<Picture> pics=task.getPictures();
  Picture pic;
  Setting setting=((EgDownloaderWindow)mainWindow).setting;
  JTable table=((EgDownloaderWindow)mainWindow).runningTable;
  InputStream is;
  if (pics.size() != 0) {
    for (int i=0; i < pics.size(); i++) {
      pic=pics.get(i);
      if (pic.getUrl() != null && !pic.isRunning() && !pic.isCompleted()) {
        try {
          if (pic.getRealUrl() == null) {
            pic.setRealUrl(ParseEngine.getdownloadUrl(pic.getUrl(),setting));
          }
          is=WebClient.getStreamUseJava(pic.getRealUrl());
          int size=is.available();
          WebClient.storeStream(task.getSaveDir() + "String_Node_Str",pic.getName(),is);
          pic.setSize(size);
          pic.setTime(new SimpleDateFormat("String_Node_Str").format(new Date()));
          pic.setCompleted(true);
          task.setCurrent(task.getCurrent() + 1);
          final String taskUrl=task.getUrl();
          Db4oTemplate.update(new Predicate<Task>(){
            public boolean match(            Task task){
              return task.getUrl() == taskUrl;
            }
          }
,task,ComponentConst.TASK_DATA_PATH);
          table.updateUI();
        }
 catch (        Exception e) {
          System.out.println(e.getMessage());
          continue;
        }
      }
    }
  }
  if (task.getCurrent() < pics.size()) {
    doInBackground();
  }
 else {
    task.setStatus(TaskStatus.COMPLETED);
  }
  return null;
}

Fixed version (ground truth):
protected Void doInBackground() throws Exception {
  task.setStatus(TaskStatus.STARTED);
  List<Picture> pics=task.getPictures();
  Picture pic;
  Setting setting=((EgDownloaderWindow)mainWindow).setting;
  JTable table=((EgDownloaderWindow)mainWindow).runningTable;
  InputStream is;
  if (pics.size() != 0) {
    for (int i=0; i < pics.size(); i++) {
      pic=pics.get(i);
      if (pic.getUrl() != null && !pic.isRunning() && !pic.isCompleted()) {
        try {
          if (pic.getRealUrl() == null) {
            pic.setRealUrl(ParseEngine.getdownloadUrl(pic.getUrl(),setting));
          }
          is=WebClient.getStreamUseJava(pic.getRealUrl());
          int size=is.available();
          WebClient.storeStream(task.getSaveDir() + "String_Node_Str",pic.getName(),is);
          pic.setSize(size);
          pic.setTime(new SimpleDateFormat("String_Node_Str").format(new Date()));
          pic.setCompleted(true);
          task.setCurrent(task.getCurrent() + 1);
          final String taskUrl=task.getUrl();
          Db4oTemplate.update(new Predicate<Task>(){
            public boolean match(            Task task){
              return task.getUrl().equals(taskUrl);
            }
          }
,task,ComponentConst.TASK_DATA_PATH);
          table.updateUI();
        }
 catch (        Exception e) {
          System.out.println(e.getMessage());
          continue;
        }
      }
    }
  }
  if (task.getCurrent() < pics.size()) {
    doInBackground();
  }
 else {
    task.setStatus(TaskStatus.COMPLETED);
  }
  return null;
}
Program: 81683
Project: 81683
Buggy source:
public boolean match(Task task){
  return task.getUrl() == taskUrl;
}

Fixed version (ground truth):
public boolean match(Task task){
  return task.getUrl().equals(taskUrl);
}
Program: 81684
Project: 81684
Buggy source:
/** 
 * Extracts the query string from the request.
 * @param httpRequest current HTTP request
 * @return query string from the request
 */
public static Map<String,List<String>> extractQueryString(final Http.Request httpRequest){
  return httpRequest.queryString().entrySet().stream().collect(toMap(Map.Entry::getKey,entry -> asList(entry.getValue())));
}

Fixed version (ground truth):
/** 
 * Extracts the query string from the request.
 * @param httpRequest current HTTP request
 * @param ignoredParams params that should not be included in the link
 * @return query string from the request
 */
public static Map<String,List<String>> extractQueryString(final Http.Request httpRequest,final Set<String> ignoredParams){
  return httpRequest.queryString().entrySet().stream().filter(stringEntry -> !ignoredParams.contains(stringEntry.getKey())).collect(toMap(Map.Entry::getKey,entry -> asList(entry.getValue())));
}
Program: 81685
Project: 81685
Buggy source:
@Override protected void fillValue(final FacetOptionViewModel viewModel,final TermFacetResult stats,final Category category,@Nullable final Category selectedValue){
  productReverseRouter.productOverviewPageCall(category).ifPresent(call -> {
    viewModel.setValue(buildUri(call.url(),extractQueryString(Http.Context.current().request())));
  }
);
}

Fixed version (ground truth):
@Override protected void fillValue(final FacetOptionViewModel viewModel,final TermFacetResult stats,final Category category,@Nullable final Category selectedValue){
  productReverseRouter.productOverviewPageCall(category).ifPresent(call -> {
    viewModel.setValue(buildUri(call.url(),extractQueryString(Http.Context.current().request(),IGNORED_PARAMS)));
  }
);
}
Program: 81686
Project: 81686
Buggy source:
protected void fillImageUrl(final WishlistItemViewModel viewModel,final LineItem lineItem){
  if (lineItem != null) {
    final String imageUrl=lineItem.getVariant().getImages().stream().findFirst().map(image -> image.getUrl()).orElse(null);
    viewModel.setImageUrl(imageUrl);
  }
}

Fixed version (ground truth):
protected void fillImageUrl(final WishlistItemViewModel viewModel,final LineItem lineItem){
  if (lineItem != null && lineItem.getVariant() != null) {
    final String imageUrl=lineItem.getVariant().getImages().stream().findFirst().map(image -> image.getUrl()).orElse(null);
    viewModel.setImageUrl(imageUrl);
  }
}
Program: 81687
Project: 81687
Buggy source:
private List<Reference<Payment>> findPaymentsToRemove(final Cart cart,final Payment payment){
  return Optional.ofNullable(cart.getPaymentInfo()).map(paymentInfo -> paymentInfo.getPayments().stream().filter(paymentRef -> !paymentRef.referencesSameResource(payment)).collect(toList())).orElseGet(() -> {
    LOGGER.warn("String_Node_Str");
    return emptyList();
  }
);
}

Fixed version (ground truth):
private List<Payment> findPaymentsToRemove(final Cart cart,final Payment payment){
  return Optional.ofNullable(cart.getPaymentInfo()).map(paymentInfo -> {
    if (!hasReferencesExpanded(paymentInfo)) {
      LOGGER.warn("String_Node_Str");
    }
    return paymentInfo.getPayments().stream().filter(paymentRef -> !paymentRef.referencesSameResource(payment)).map(Reference::getObj).filter(Objects::nonNull).collect(toList());
  }
).orElseGet(Collections::emptyList);
}
Program: 81688
Project: 81688
Buggy source:
private CompletionStage<Cart> deletePreviousPayments(final Cart cart,final Payment payment){
  final List<CompletionStage<Payment>> paymentStages=findPaymentsToRemove(cart,payment).stream().map(paymentRef -> getSphereClient().execute(PaymentByIdGet.of(paymentRef))).collect(toList());
  return CompletableFutureUtils.listOfFuturesToFutureOfList(paymentStages).thenComposeAsync(payments -> {
    payments.removeIf(Objects::isNull);
    return removePaymentsFormCart(cart,payments).thenApply(updatedCart -> {
      payments.forEach(paymentToDelete -> getSphereClient().execute(PaymentDeleteCommand.of(paymentToDelete)));
      return updatedCart;
    }
);
  }
);
}

Fixed version (ground truth):
private CompletionStage<Cart> deletePreviousPayments(final Cart cart,final Payment payment){
  final List<Payment> paymentsToRemove=findPaymentsToRemove(cart,payment);
  return removePaymentsFormCart(cart,paymentsToRemove).thenApply(updatedCart -> {
    paymentsToRemove.forEach(paymentToRemove -> getSphereClient().execute(PaymentDeleteCommand.of(paymentToRemove)));
    return updatedCart;
  }
);
}
Program: 81689
Project: 81689
Buggy source:
protected final CompletableFuture<CustomerSignInResult> resultOrRecoverIfMergingCartFailed(final CompletionStage<CustomerSignInResult> resultStage,final LogInFormData formData){
  return recoverWith(resultStage,throwable -> {
    if (isInvalidOperationError(throwable.getCause())) {
      LOGGER.warn("String_Node_Str");
      return executeRequest(CustomerSignInCommand.of(formData.username(),formData.password()));
    }
    return exceptionallyCompletedFuture(throwable);
  }
);
}

Fixed version (ground truth):
protected final CompletableFuture<CustomerSignInResult> resultOrRecoverIfMergingCartFailed(final CompletionStage<CustomerSignInResult> resultStage,final LogInFormData formData){
  return recoverWith(resultStage,throwable -> {
    if (isInvalidInputError(throwable.getCause())) {
      LOGGER.warn("String_Node_Str",throwable);
      return signInWithoutCart(formData);
    }
 else     if (isInvalidOperationError(throwable.getCause())) {
      LOGGER.warn("String_Node_Str",throwable);
      return signInWithoutCart(formData);
    }
    return exceptionallyCompletedFuture(throwable);
  }
,HttpExecution.defaultContext());
}
Program: 81690
Project: 81690
Buggy source:
@Provides public Http.Context httpContext(){
  return Http.Context.current();
}

Fixed version (ground truth):
@Provides public Http.Context httpContext(){
  final Http.Context context=Http.Context.current.get();
  if (context != null) {
    return context;
  }
 else {
    return new Http.Context(new Http.RequestBuilder());
  }
}
Program: 81691
Project: 81691
Buggy source:
@Inject UserLanguageImpl(final Locale locale,final Http.Request request,final ProjectContext projectContext){
  this.locale=locale;
  this.locales=acceptedLocales(locale,request,projectContext);
  LOGGER.debug("String_Node_Str",locale,locales);
}

Fixed version (ground truth):
@Inject UserLanguageImpl(final Locale locale,final Http.Context httpContext,final ProjectContext projectContext){
  this.locale=locale;
  this.locales=acceptedLocales(locale,httpContext.request(),projectContext);
  LOGGER.debug("String_Node_Str",locale,locales);
}
Program: 81692
Project: 81692
Buggy source:
@Inject public SliderRangeFacetViewModelFactory(final I18nIdentifierResolver i18nIdentifierResolver,final Http.Request httpRequest,final SliderRangeEndpointViewModelFactory sliderRangeEndpointViewModelFactory){
  super(i18nIdentifierResolver);
  this.httpRequest=httpRequest;
  this.sliderRangeEndpointViewModelFactory=sliderRangeEndpointViewModelFactory;
}

Fixed version (ground truth):
@Inject public SliderRangeFacetViewModelFactory(final I18nIdentifierResolver i18nIdentifierResolver,final Http.Context httpContext,final SliderRangeEndpointViewModelFactory sliderRangeEndpointViewModelFactory){
  super(i18nIdentifierResolver);
  this.httpRequest=httpContext.request();
  this.sliderRangeEndpointViewModelFactory=sliderRangeEndpointViewModelFactory;
}
Program: 81693
Project: 81693
Buggy source:
@Inject public CacheableObjectStoringSessionCookieStrategy(final Http.Session session,final CacheApi cacheApi,final Configuration configuration){
  super(session);
  this.cacheApi=cacheApi;
  this.sessionIdKey=configuration.getString("String_Node_Str",DEFAULT_SESSION_ID_KEY);
}

Fixed version (ground truth):
@Inject public CacheableObjectStoringSessionCookieStrategy(final Http.Context httpContext,final CacheApi cacheApi,final Configuration configuration){
  super(httpContext);
  this.cacheApi=cacheApi;
  this.sessionIdKey=configuration.getString("String_Node_Str",DEFAULT_SESSION_ID_KEY);
}
Program: 81694
Project: 81694
Buggy source:
@Inject public SerializableObjectStoringSessionCookieStrategy(final Http.Session session){
  super(session);
}

Fixed version (ground truth):
@Inject public SerializableObjectStoringSessionCookieStrategy(final Http.Context httpContext){
  super(httpContext);
}
Program: 81695
Project: 81695
Buggy source:
@Inject public SessionCookieStrategy(final Http.Session session){
  this.session=session;
}

Fixed version (ground truth):
@Inject public SessionCookieStrategy(final Http.Context httpContext){
  this.session=httpContext.session();
}
Program: 81696
Project: 81696
Buggy source:
@Inject public CategoryTreeFacetOptionViewModelFactory(final UserLanguage userLanguage,final Http.Request httpRequest,final CategoryTree categoryTree,final ProductReverseRouter productReverseRouter){
  this.locales=userLanguage.locales();
  this.httpRequest=httpRequest;
  this.categoryTree=categoryTree;
  this.productReverseRouter=productReverseRouter;
}

Fixed version (ground truth):
@Inject public CategoryTreeFacetOptionViewModelFactory(final UserLanguage userLanguage,final Http.Context httpContext,final CategoryTree categoryTree,final ProductReverseRouter productReverseRouter){
  this.locales=userLanguage.locales();
  this.httpRequest=httpContext.request();
  this.categoryTree=categoryTree;
  this.productReverseRouter=productReverseRouter;
}
Program: 81697
Project: 81697
Buggy source:
@Inject public ProductOverviewPageContentFactory(final Locale locale,final Http.Request httpRequest,final CategoryBreadcrumbViewModelFactory categoryBreadcrumbViewModelFactory,final ProductListViewModelFactory productListViewModelFactory,final BannerViewModelFactory bannerViewModelFactory,final JumbotronViewModelFactory jumbotronViewModelFactory,final SeoViewModelFactory seoViewModelFactory){
  this.locale=locale;
  this.httpRequest=httpRequest;
  this.categoryBreadcrumbViewModelFactory=categoryBreadcrumbViewModelFactory;
  this.productListViewModelFactory=productListViewModelFactory;
  this.bannerViewModelFactory=bannerViewModelFactory;
  this.jumbotronViewModelFactory=jumbotronViewModelFactory;
  this.seoViewModelFactory=seoViewModelFactory;
}

Fixed version (ground truth):
@Inject public ProductOverviewPageContentFactory(final Locale locale,final Http.Context httpContext,final CategoryBreadcrumbViewModelFactory categoryBreadcrumbViewModelFactory,final ProductListViewModelFactory productListViewModelFactory,final BannerViewModelFactory bannerViewModelFactory,final JumbotronViewModelFactory jumbotronViewModelFactory,final SeoViewModelFactory seoViewModelFactory){
  this.locale=locale;
  this.httpRequest=httpContext.request();
  this.categoryBreadcrumbViewModelFactory=categoryBreadcrumbViewModelFactory;
  this.productListViewModelFactory=productListViewModelFactory;
  this.bannerViewModelFactory=bannerViewModelFactory;
  this.jumbotronViewModelFactory=jumbotronViewModelFactory;
  this.seoViewModelFactory=seoViewModelFactory;
}
Program: 81698
Project: 81698
Buggy source:
/** 
 * Gets products from the same categories as the given product, excluding the product itself, up to   {@code numProducts}. Most expensive products first.
 * @param product the product to get suggestions for
 * @param numProducts the number of products the returned set should contain
 * @return the products related to this product
 */
@Override public CompletionStage<Set<ProductProjection>> relatedToProduct(final ProductProjection product,final int numProducts){
  final Set<String> categoryIds=product.getCategories().stream().map(Reference::getId).collect(toSet());
  return productsFromCategoryIds(categoryIds,numProducts + 1).thenApply(products -> products.stream().filter(p -> !p.getId().equals(product.getId())).limit(numProducts).collect(toSet()));
}

Fixed version (ground truth):
/** 
 * Gets products from the same categories as the given product, excluding the product itself, up to   {@code numProducts}. Most expensive products first.
 * @param product the product to get suggestions for
 * @param numProducts the number of products the returned set should contain
 * @return the products related to this product
 */
@Override public CompletionStage<Set<ProductProjection>> relatedToProduct(final ProductProjection product,final int numProducts){
  final Set<String> categoryIds=product.getCategories().stream().map(Reference::getId).collect(toSet());
  if (categoryIds.isEmpty()) {
    return CompletableFuture.completedFuture(emptySet());
  }
 else {
    return productsFromCategoryIds(categoryIds,numProducts + 1).thenApply(products -> products.stream().filter(p -> !p.getId().equals(product.getId())).limit(numProducts).collect(toSet()));
  }
}
Program: 81699
Project: 81699
Buggy source:
@Inject public ReflectionWebJarAssetsReverseRouter(final ParsedRoutes parsedRoutes){
  final boolean routeIsPresent=parsedRoutes.getRoutes().stream().filter(p -> "String_Node_Str".equals(p.getRouteDocumentation().getControllerMethodInvocation())).findFirst().map(p -> p).isPresent();
  if (routeIsPresent) {
    try {
      final Class<?> routesClass=Class.forName("String_Node_Str");
      final Class<?> reverseControllerClass=Class.forName("String_Node_Str");
      final Field field=routesClass.getField("String_Node_Str");
      final Object o=field.get(null);
      final Method reverseRouteMethod=reverseControllerClass.getMethod("String_Node_Str",new Class<?>[]{String.class});
      reverseCaller=new ReflectionReverseCaller(reverseRouteMethod,o);
    }
 catch (    ClassNotFoundException|NoSuchFieldException|IllegalAccessException|NoSuchMethodException e) {
      throw new CompletionException(e);
    }
  }
 else {
    throw new CompletionException(new RuntimeException("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Inject public ReflectionWebJarAssetsReverseRouter(final ParsedRoutes parsedRoutes){
  final boolean routeIsPresent=parsedRoutes.getRoutes().stream().filter(p -> "String_Node_Str".equals(p.getRouteDocumentation().getControllerMethodInvocation())).findFirst().map(p -> p).isPresent();
  if (routeIsPresent) {
    try {
      final Class<?> routesClass=getClassByName("String_Node_Str");
      final Class<?> reverseControllerClass=getClassByName("String_Node_Str");
      final Field field=routesClass.getField("String_Node_Str");
      final Object o=field.get(null);
      final Method reverseRouteMethod=reverseControllerClass.getMethod("String_Node_Str",new Class<?>[]{String.class});
      reverseCaller=new ReflectionReverseCaller(reverseRouteMethod,o);
    }
 catch (    ClassNotFoundException|NoSuchFieldException|IllegalAccessException|NoSuchMethodException e) {
      throw new CompletionException(e);
    }
  }
 else {
    throw new CompletionException(new RuntimeException("String_Node_Str"));
  }
}
Program: 81700
Project: 81700
Buggy source:
private ParsedRoute parse(final Router.RouteDocumentation rd){
  final ParsedRoute parsedRoute=new ParsedRoute();
  parsedRoute.setRouteDocumentation(rd);
  if (countMatches(rd.getControllerMethodInvocation(),'@') == 2) {
    final String s=StringUtils.removeStart(rd.getControllerMethodInvocation(),"String_Node_Str");
    final String controllerClassName=s.substring(0,s.indexOf("String_Node_Str"));
    try {
      final Class<?> clazz=Class.forName(controllerClassName);
      parsedRoute.setControllerClass(clazz);
    }
 catch (    ClassNotFoundException e) {
      throw new CompletionException(e);
    }
  }
  return parsedRoute;
}

Fixed version (ground truth):
private ParsedRoute parse(final Router.RouteDocumentation rd){
  final ParsedRoute parsedRoute=new ParsedRoute();
  parsedRoute.setRouteDocumentation(rd);
  if (countMatches(rd.getControllerMethodInvocation(),'@') == 2) {
    final String s=StringUtils.removeStart(rd.getControllerMethodInvocation(),"String_Node_Str");
    final String controllerClassName=s.substring(0,s.indexOf("String_Node_Str"));
    try {
      final Class<?> clazz=getClassByName(controllerClassName);
      parsedRoute.setControllerClass(clazz);
    }
 catch (    ClassNotFoundException e) {
      throw new CompletionException(e);
    }
  }
  return parsedRoute;
}
Program: 81701
Project: 81701
Buggy source:
private Optional<Pair<Object,Method>> createPair(final Method controllerMethod,final Class<?> controllerClass){
  try {
    final String packageName=controllerClass.getPackage().getName();
    final Class<?> reverseRouter=Class.forName(packageName + "String_Node_Str");
    final Field field=reverseRouter.getField(controllerClass.getSimpleName());
    final Object o=field.get(null);
    final Method reverseRouteMethod=o.getClass().getMethod(controllerMethod.getName(),controllerMethod.getParameterTypes());
    return Optional.ofNullable(ImmutablePair.of(o,reverseRouteMethod));
  }
 catch (  final NoSuchMethodException e) {
    return Optional.empty();
  }
catch (  final Exception e) {
    throw new CompletionException(e);
  }
}

Fixed version (ground truth):
private Optional<Pair<Object,Method>> createPair(final Method controllerMethod,final Class<?> controllerClass){
  try {
    final String packageName=controllerClass.getPackage().getName();
    final Class<?> reverseRouter=getClassByName(packageName + "String_Node_Str");
    final Field field=reverseRouter.getField(controllerClass.getSimpleName());
    final Object o=field.get(null);
    final Method reverseRouteMethod=o.getClass().getMethod(controllerMethod.getName(),controllerMethod.getParameterTypes());
    return Optional.ofNullable(ImmutablePair.of(o,reverseRouteMethod));
  }
 catch (  final NoSuchMethodException e) {
    return Optional.empty();
  }
catch (  final Exception e) {
    throw new CompletionException(e);
  }
}
Program: 81702
Project: 81702
Buggy source:
@Override public SphereClient get(){
  final MetricHttpClient metricHttpClient=MetricHttpClient.of(httpClient,context);
  logger.info("String_Node_Str");
  final SphereClient sphereClient=SphereClient.of(sphereClientConfig,metricHttpClient,sphereAccessTokenSupplier);
  applicationLifecycle.addStopHook(() -> {
    sphereClient.close();
    return completedFuture(null);
  }
);
  return sphereClient;
}

Fixed version (ground truth):
@Override public SphereClient get(){
  final MetricHttpClient metricHttpClient=MetricHttpClient.of(httpClient,context);
  logger.info("String_Node_Str");
  return SphereClient.of(sphereClientConfig,metricHttpClient,sphereAccessTokenSupplier);
}
Program: 81703
Project: 81703
Buggy source:
protected CompletionStage<Cart> withPaymentsToRemove(final Cart cart,final List<PaymentMethodInfo> selectedPaymentMethods,final Function<List<Payment>,CompletionStage<Cart>> setPaymentAction){
  final List<Reference<Payment>> paymentRefs=Optional.ofNullable(cart.getPaymentInfo()).map(PaymentInfo::getPayments).orElseGet(() -> {
    Logger.error("String_Node_Str");
    return emptyList();
  }
);
  final List<CompletionStage<Payment>> paymentStages=paymentRefs.stream().map(paymentRef -> sphere().execute(PaymentByIdGet.of(paymentRef))).collect(toList());
  return CompletableFutureUtils.listOfFuturesToFutureOfList(paymentStages).thenComposeAsync(payments -> {
    payments.removeIf(Objects::isNull);
    final CompletionStage<Cart> updatedCartStage=setPaymentAction.apply(payments);
    updatedCartStage.thenAccept(updatedCart -> payments.forEach(payment -> sphere().execute(PaymentDeleteCommand.of(payment))));
    return updatedCartStage;
  }
);
}

Fixed version (ground truth):
protected CompletionStage<Cart> withPaymentsToRemove(final Cart cart,final List<PaymentMethodInfo> selectedPaymentMethods,final Function<List<Payment>,CompletionStage<Cart>> setPaymentAction){
  final List<Reference<Payment>> paymentRefs=Optional.ofNullable(cart.getPaymentInfo()).map(PaymentInfo::getPayments).orElseGet(() -> {
    logger.error("String_Node_Str");
    return emptyList();
  }
);
  final List<CompletionStage<Payment>> paymentStages=paymentRefs.stream().map(paymentRef -> sphere().execute(PaymentByIdGet.of(paymentRef))).collect(toList());
  return CompletableFutureUtils.listOfFuturesToFutureOfList(paymentStages).thenComposeAsync(payments -> {
    payments.removeIf(Objects::isNull);
    final CompletionStage<Cart> updatedCartStage=setPaymentAction.apply(payments);
    updatedCartStage.thenAccept(updatedCart -> payments.forEach(payment -> sphere().execute(PaymentDeleteCommand.of(payment))));
    return updatedCartStage;
  }
);
}
Program: 81704
Project: 81704
Buggy source:
@Inject private void setMultiControllerComponents(@Named("String_Node_Str") final MultiControllerComponentResolver controllersMultiComponent,final MultiControllerComponentResolver multiComponent,final Injector injector){
  addMultiComponents(controllersMultiComponent,injector);
  addMultiComponents(multiComponent,injector);
}

Fixed version (ground truth):
@Inject(optional=true) private void setMultiControllerComponents(@Nullable @Named("String_Node_Str") final MultiControllerComponentResolver controllersMultiComponent,final MultiControllerComponentResolver multiComponent,final Injector injector){
  if (controllersMultiComponent != null) {
    addMultiComponents(controllersMultiComponent,injector);
  }
  if (multiComponent != null) {
    addMultiComponents(multiComponent,injector);
  }
}
Program: 81705
Project: 81705
Buggy source:
protected void addMultiComponents(final MultiControllerComponentResolver multiComponent,final Injector injector){
  final List<Class<? extends ControllerComponent>> components=multiComponent.findMatchingComponents(this);
  components.forEach(clazz -> {
    final ControllerComponent instance=injector.getInstance(clazz);
    hooks().add(instance);
  }
);
}

Fixed version (ground truth):
private void addMultiComponents(final MultiControllerComponentResolver multiComponent,final Injector injector){
  final List<Class<? extends ControllerComponent>> components=multiComponent.findMatchingComponents(this);
  components.forEach(clazz -> {
    final ControllerComponent instance=injector.getInstance(clazz);
    hooks().add(instance);
  }
);
}
Program: 81706
Project: 81706
Buggy source:
private CartQuery createQueryForPrimaryCart(final Http.Session session){
  final String nullableCustomerId=CustomerSessionUtils.getCustomerId(session).orElse(null);
  final String nullableCartId=CartSessionUtils.getCartId(session).orElse(null);
  CartQuery query=CartQuery.of();
  if (nullableCustomerId != null) {
    query=query.plusPredicates(cart -> cart.customerId().is(nullableCustomerId));
  }
 else   if (nullableCartId != null) {
    query.plusPredicates(cart -> cart.id().is(nullableCartId));
  }
  query=query.plusPredicates(cart -> cart.cartState().is(CartState.ACTIVE)).plusExpansionPaths(c -> c.shippingInfo().shippingMethod()).plusExpansionPaths(c -> c.paymentInfo().payments()).withSort(cart -> cart.lastModifiedAt().sort().desc()).withLimit(1);
  query=hooks().runFilterHook(CartQueryFilterHook.class,(hook,q) -> hook.filterCartQuery(q),query);
  return query;
}

Fixed version (ground truth):
private CartQuery createQueryForPrimaryCart(final Http.Session session){
  final String nullableCustomerId=CustomerSessionUtils.getCustomerId(session).orElse(null);
  final String nullableCartId=CartSessionUtils.getCartId(session).orElse(null);
  CartQuery query=CartQuery.of();
  if (nullableCustomerId != null) {
    query=query.plusPredicates(cart -> cart.customerId().is(nullableCustomerId));
  }
 else   if (nullableCartId != null) {
    query=query.plusPredicates(cart -> cart.id().is(nullableCartId));
  }
  query=query.plusPredicates(cart -> cart.cartState().is(CartState.ACTIVE)).plusExpansionPaths(c -> c.shippingInfo().shippingMethod()).plusExpansionPaths(c -> c.paymentInfo().payments()).withSort(cart -> cart.lastModifiedAt().sort().desc()).withLimit(1);
  query=hooks().runFilterHook(CartQueryFilterHook.class,(hook,q) -> hook.filterCartQuery(q),query);
  return query;
}
Program: 81708
Project: 81708
Buggy source:
protected CompletionStage<Result> handleInvalidForm(final Form<? extends AddProductToCartFormDataLike> form){
  flash(UserFeedback.ERROR,"String_Node_Str");
  return successfulResult();
}

Fixed version (ground truth):
protected CompletionStage<Result> handleInvalidForm(final Form<? extends AddProductToCartFormDataLike> form){
  injector.getInstance(UserFeedback.class).addErrors(form);
  return successfulResult();
}
Program: 81709
Project: 81709
Buggy source:
protected CompletionStage<Result> handleInvalidForm(final Form<ChangeLineItemQuantityFormData> form){
  flash(UserFeedback.ERROR,"String_Node_Str");
  return completedFuture(redirect(reverseRouter.showCart(userContext().languageTag())));
}

Fixed version (ground truth):
protected CompletionStage<Result> handleInvalidForm(final Form<ChangeLineItemQuantityFormData> form){
  injector.getInstance(UserFeedback.class).addErrors(form);
  return completedFuture(redirect(reverseRouter.showCart(userContext().languageTag())));
}
Program: 81710
Project: 81710
Buggy source:
protected CompletionStage<Result> handleRemoveLineItemError(final Throwable throwable,final Form<RemoveLineItemFormData> removeLineItemForm,final Cart cart){
  flash(UserFeedback.ERROR,"String_Node_Str");
  return completedFuture(redirect(reverseRouter.showCart(userContext().languageTag())));
}

Fixed version (ground truth):
protected CompletionStage<Result> handleRemoveLineItemError(final Throwable throwable,final Form<RemoveLineItemFormData> removeLineItemForm,final Cart cart){
  injector.getInstance(UserFeedback.class).addErrors("String_Node_Str");
  return completedFuture(redirect(reverseRouter.showCart(userContext().languageTag())));
}
Program: 81711
Project: 81711
Buggy source:
protected CompletionStage<Result> handleRemoveLineItemFormErrors(final Form<RemoveLineItemFormData> removeLineItemForm,final Cart cart){
  flash(UserFeedback.ERROR,"String_Node_Str");
  return completedFuture(redirect(reverseRouter.showCart(userContext().languageTag())));
}

Fixed version (ground truth):
protected CompletionStage<Result> handleRemoveLineItemFormErrors(final Form<RemoveLineItemFormData> removeLineItemForm,final Cart cart){
  injector.getInstance(UserFeedback.class).addErrors(removeLineItemForm);
  return completedFuture(redirect(reverseRouter.showCart(userContext().languageTag())));
}
Program: 81712
Project: 81712
Buggy source:
protected Html renderPage(final ProductOverviewPageContent pageContent){
  final SunrisePageData pageData=pageData(userContext,pageContent,ctx(),session());
  return templateEngine().renderToHtml("String_Node_Str",pageData,userContext.locales());
}

Fixed version (ground truth):
protected Html renderPage(final ProductOverviewPageContent pageContent){
  final SunrisePageData pageData=pageData(pageContent);
  return templateEngine().renderToHtml("String_Node_Str",pageData,userContext.locales());
}
Program: 81713
Project: 81713
Buggy source:
protected final <T>CompletionStage<?> runAsyncHook(final Class<T> hookClass,final Function<T,CompletionStage<Object>> f){
  final List<? extends CompletionStage<Object>> collect=controllerComponents.stream().filter(x -> hookClass.isAssignableFrom(x.getClass())).map(hook -> f.apply((T)hook)).collect(Collectors.toList());
  return FutureUtils.listOfFuturesToFutureOfList(collect);
}

Fixed version (ground truth):
protected final <T>CompletionStage<Object> runAsyncHook(final Class<T> hookClass,final Function<T,CompletionStage<?>> f){
  final List<CompletionStage<Void>> collect=controllerComponents.stream().filter(x -> hookClass.isAssignableFrom(x.getClass())).map(hook -> f.apply((T)hook)).map(stage -> (CompletionStage<Void>)stage).collect(Collectors.toList());
  final CompletionStage<?> listCompletionStage=FutureUtils.listOfFuturesToFutureOfList(collect);
  return listCompletionStage.thenApply(z -> null);
}
Program: 81714
Project: 81714
Buggy source:
@AddCSRFToken public CompletionStage<Result> show(final String languageTag){
  final CompletionStage<Cart> loadedCart=getOrCreateCart();
  final CompletionStage<?> stage=loadedCart.thenComposeAsync(cart -> runAsyncHook(CartLoadedHook.class,hook -> hook.cartLoaded(cart)),HttpExecution.defaultContext());
  return loadedCart.thenCombineAsync(stage,(cart,loadedCartHooksResult) -> showCheckoutAddressPage(cart),HttpExecution.defaultContext());
}

Fixed version (ground truth):
@AddCSRFToken public CompletionStage<Result> show(final String languageTag){
  final CompletionStage<Cart> loadedCart=getOrCreateCart();
  final CompletionStage<Object> completionStage=loadedCart.thenComposeAsync(cart -> runAsyncHook(CartLoadedHook.class,hook -> hook.cartLoaded(cart)),HttpExecution.defaultContext());
  return loadedCart.thenCombineAsync(completionStage,(cart,loadedCartHooksResult) -> showCheckoutAddressPage(cart),HttpExecution.defaultContext());
}