nus-yam/ex-repair huggingface dataset:
Program: 96392
Project: 96392
Buggy source:
@Override public void createTray(String iconName){
  libgtk.gdk_threads_enter();
  this.appIndicator=libappindicator.app_indicator_new(this.appName,"String_Node_Str",AppIndicator.CATEGORY_APPLICATION_STATUS);
  AppIndicator.AppIndicatorClassStruct aiclass=new AppIndicator.AppIndicatorClassStruct(this.appIndicator.parent.g_type_instance.g_class);
  aiclass.fallback=new AppIndicator.Fallback(){
    @Override public Pointer callback(    final AppIndicator.AppIndicatorInstanceStruct self){
      AppIndicatorTray.this.callbackExecutor.execute(new Runnable(){
        @Override public void run(){
          logger.warn("String_Node_Str");
          if (AppIndicatorTray.this.failureCallback != null) {
            AppIndicatorTray.this.failureCallback.createTrayFailed();
          }
        }
      }
);
      return null;
    }
  }
;
  aiclass.write();
  this.menu=libgtk.gtk_menu_new();
  libappindicator.app_indicator_set_menu(this.appIndicator,this.menu);
  libappindicator.app_indicator_set_icon_full(this.appIndicator,iconPath(iconName),this.appName);
  libappindicator.app_indicator_set_status(this.appIndicator,AppIndicator.STATUS_ACTIVE);
  libgtk.gdk_threads_leave();
  if (!useSWT) {
    Thread gtkUpdateThread=new Thread(){
      @Override public void run(){
        AppIndicatorTray.this.blockUntilStarted.countDown();
        libgtk.gtk_main();
      }
    }
;
    gtkUpdateThread.setName("String_Node_Str");
    gtkUpdateThread.start();
  }
  try {
    this.blockUntilStarted.await();
    this.active=true;
  }
 catch (  InterruptedException ignored) {
  }
}

Fixed version (ground truth):
@Override public void createTray(String iconName){
  libgtk.gdk_threads_enter();
  this.appIndicator=libappindicator.app_indicator_new(this.appName,"String_Node_Str",AppIndicator.CATEGORY_APPLICATION_STATUS);
  AppIndicator.AppIndicatorClassStruct aiclass=new AppIndicator.AppIndicatorClassStruct(this.appIndicator.parent.g_type_instance.g_class);
  aiclass.fallback=new AppIndicator.Fallback(){
    @Override public Pointer callback(    final AppIndicator.AppIndicatorInstanceStruct self){
      AppIndicatorTray.this.callbackExecutor.execute(new Runnable(){
        @Override public void run(){
          logger.warn("String_Node_Str");
          if (AppIndicatorTray.this.failureCallback != null) {
            AppIndicatorTray.this.failureCallback.createTrayFailed();
          }
        }
      }
);
      return null;
    }
  }
;
  aiclass.write();
  this.menu=libgtk.gtk_menu_new();
  libappindicator.app_indicator_set_menu(this.appIndicator,this.menu);
  libappindicator.app_indicator_set_icon_full(this.appIndicator,iconPath(iconName),this.appName);
  libappindicator.app_indicator_set_status(this.appIndicator,AppIndicator.STATUS_ACTIVE);
  libgtk.gdk_threads_leave();
  this.active=true;
}
Program: 96394
Project: 96394
Buggy source:
public SystemTrayMenuPopup(){
  super();
  this.timer=new DelayTimer("String_Node_Str",true,new DelayTimer.Callback(){
    @Override public void execute(){
      SwingUtilities.invokeLater(new Runnable(){
        @Override public void run(){
          Point location=MouseInfo.getPointerInfo().getLocation();
          Point locationOnScreen=getLocationOnScreen();
          Dimension size=getSize();
          if (location.x >= locationOnScreen.x && location.x < locationOnScreen.x + size.width && location.y >= locationOnScreen.y && location.y < locationOnScreen.y + size.height) {
            SystemTrayMenuPopup.this.timer.delay(SystemTrayMenuPopup.this.timer.getDelay());
          }
 else {
            setVisible(false);
          }
        }
      }
);
    }
  }
);
  addMouseListener(new MouseAdapter(){
    @Override public void mouseExited(    MouseEvent event){
      SystemTrayMenuPopup.this.timer.delay(SystemTrayMenuPopup.this.timer.getDelay());
    }
  }
);
}

Fixed version (ground truth):
public SystemTrayMenuPopup(){
  super();
  this.timer=new DelayTimer("String_Node_Str",true,new DelayTimer.Callback(){
    @Override public void execute(){
      SwingUtil.invokeLater(new Runnable(){
        @Override public void run(){
          Point location=MouseInfo.getPointerInfo().getLocation();
          Point locationOnScreen=getLocationOnScreen();
          Dimension size=getSize();
          if (location.x >= locationOnScreen.x && location.x < locationOnScreen.x + size.width && location.y >= locationOnScreen.y && location.y < locationOnScreen.y + size.height) {
            SystemTrayMenuPopup.this.timer.delay(SystemTrayMenuPopup.this.timer.getDelay());
          }
 else {
            setVisible(false);
          }
        }
      }
);
    }
  }
);
  addMouseListener(new MouseAdapter(){
    @Override public void mouseExited(    MouseEvent event){
      SystemTrayMenuPopup.this.timer.delay(SystemTrayMenuPopup.this.timer.getDelay());
    }
  }
);
}
Program: 96395
Project: 96395
Buggy source:
@Override public void execute(){
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      Point location=MouseInfo.getPointerInfo().getLocation();
      Point locationOnScreen=getLocationOnScreen();
      Dimension size=getSize();
      if (location.x >= locationOnScreen.x && location.x < locationOnScreen.x + size.width && location.y >= locationOnScreen.y && location.y < locationOnScreen.y + size.height) {
        SystemTrayMenuPopup.this.timer.delay(SystemTrayMenuPopup.this.timer.getDelay());
      }
 else {
        setVisible(false);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void execute(){
  SwingUtil.invokeLater(new Runnable(){
    @Override public void run(){
      Point location=MouseInfo.getPointerInfo().getLocation();
      Point locationOnScreen=getLocationOnScreen();
      Dimension size=getSize();
      if (location.x >= locationOnScreen.x && location.x < locationOnScreen.x + size.width && location.y >= locationOnScreen.y && location.y < locationOnScreen.y + size.height) {
        SystemTrayMenuPopup.this.timer.delay(SystemTrayMenuPopup.this.timer.getDelay());
      }
 else {
        setVisible(false);
      }
    }
  }
);
}
Program: 96396
Project: 96396
Buggy source:
@Override public void removeTray(){
  for (  Pointer widget : this.widgets) {
    libgtk.gtk_widget_destroy(widget);
  }
  libappindicator.app_indicator_set_status(this.appIndicator,AppIndicator.STATUS_PASSIVE);
  this.appIndicator.write();
  Pointer p=this.appIndicator.getPointer();
  libgobject.g_object_unref(p);
  this.active=false;
  this.appIndicator=null;
  this.widgets.clear();
  libgobject.g_object_unref(this.menu);
  this.menu=null;
synchronized (this.menuEntries) {
    this.menuEntries.clear();
  }
  this.connectionStatusItem=null;
  super.removeTray();
}

Fixed version (ground truth):
@Override public void removeTray(){
  libgtk.gdk_threads_enter();
  for (  Pointer widget : this.widgets) {
    libgtk.gtk_widget_destroy(widget);
  }
  libappindicator.app_indicator_set_status(this.appIndicator,AppIndicator.STATUS_PASSIVE);
  this.appIndicator.write();
  Pointer p=this.appIndicator.getPointer();
  libgobject.g_object_unref(p);
  this.active=false;
  this.appIndicator=null;
  this.widgets.clear();
  libgobject.g_object_unref(this.menu);
  this.menu=null;
synchronized (this.menuEntries) {
    this.menuEntries.clear();
  }
  this.connectionStatusItem=null;
  libgtk.gtk_main_quit();
  libgtk.gdk_threads_leave();
  super.removeTray();
}
Program: 96397
Project: 96397
Buggy source:
/** 
 * Will update an already existing menu entry (or add a new one, if it doesn't exist)
 */
@Override public void updateMenuEntry(String origMenuText,String newMenuText,final SystemTrayMenuAction newCallback){
synchronized (this.menuEntries) {
    MenuEntry menuEntry=this.menuEntries.get(origMenuText);
    if (menuEntry != null) {
      libgtk.gtk_menu_item_set_label(menuEntry.dashboardItem,newMenuText);
      Gobject.GCallback gtkCallback=new Gobject.GCallback(){
        @Override public void callback(        Pointer instance,        Pointer data){
          AppIndicatorTray.this.callbackExecutor.execute(new Runnable(){
            @Override public void run(){
              newCallback.onClick(AppIndicatorTray.this);
            }
          }
);
        }
      }
;
      libgobject.g_signal_connect_data(menuEntry.dashboardItem,"String_Node_Str",gtkCallback,null,null,0);
      libgtk.gtk_widget_show_all(menuEntry.dashboardItem);
    }
 else {
      addMenuEntry(origMenuText,newCallback);
    }
  }
}

Fixed version (ground truth):
/** 
 * Will update an already existing menu entry (or add a new one, if it doesn't exist)
 */
@Override public void updateMenuEntry(String origMenuText,String newMenuText,final SystemTrayMenuAction newCallback){
synchronized (this.menuEntries) {
    MenuEntry menuEntry=this.menuEntries.get(origMenuText);
    if (menuEntry != null) {
      libgtk.gdk_threads_enter();
      libgtk.gtk_menu_item_set_label(menuEntry.dashboardItem,newMenuText);
      menuEntry.gtkCallback=new Gobject.GCallback(){
        @Override public void callback(        Pointer instance,        Pointer data){
          AppIndicatorTray.this.callbackExecutor.execute(new Runnable(){
            @Override public void run(){
              newCallback.onClick(AppIndicatorTray.this);
            }
          }
);
        }
      }
;
      libgobject.g_signal_connect_data(menuEntry.dashboardItem,"String_Node_Str",menuEntry.gtkCallback,null,null,0);
      libgtk.gtk_widget_show_all(menuEntry.dashboardItem);
      libgtk.gdk_threads_leave();
    }
 else {
      addMenuEntry(origMenuText,newCallback);
    }
  }
}
Program: 96398
Project: 96398
Buggy source:
/** 
 * Will add a new menu entry, or update one if it already exists
 */
@Override public void addMenuEntry(String menuText,final SystemTrayMenuAction callback){
synchronized (this.menuEntries) {
    MenuEntry menuEntry=this.menuEntries.get(menuText);
    if (menuEntry == null) {
      Pointer dashboardItem=libgtk.gtk_menu_item_new_with_label(menuText);
      Gobject.GCallback gtkCallback=new Gobject.GCallback(){
        @Override public void callback(        Pointer instance,        Pointer data){
          AppIndicatorTray.this.callbackExecutor.execute(new Runnable(){
            @Override public void run(){
              callback.onClick(AppIndicatorTray.this);
            }
          }
);
        }
      }
;
      libgobject.g_signal_connect_data(dashboardItem,"String_Node_Str",gtkCallback,null,null,0);
      libgtk.gtk_menu_shell_append(this.menu,dashboardItem);
      libgtk.gtk_widget_show_all(dashboardItem);
      menuEntry=new MenuEntry();
      menuEntry.dashboardItem=dashboardItem;
      this.menuEntries.put(menuText,menuEntry);
    }
 else {
      updateMenuEntry(menuText,menuText,callback);
    }
  }
}

Fixed version (ground truth):
/** 
 * Will add a new menu entry, or update one if it already exists
 */
@Override public void addMenuEntry(String menuText,final SystemTrayMenuAction callback){
synchronized (this.menuEntries) {
    MenuEntry menuEntry=this.menuEntries.get(menuText);
    if (menuEntry == null) {
      libgtk.gdk_threads_enter();
      Pointer dashboardItem=libgtk.gtk_menu_item_new_with_label(menuText);
      Gobject.GCallback gtkCallback=new Gobject.GCallback(){
        @Override public void callback(        Pointer instance,        Pointer data){
          AppIndicatorTray.this.callbackExecutor.execute(new Runnable(){
            @Override public void run(){
              callback.onClick(AppIndicatorTray.this);
            }
          }
);
        }
      }
;
      libgobject.g_signal_connect_data(dashboardItem,"String_Node_Str",gtkCallback,null,null,0);
      libgtk.gtk_menu_shell_append(this.menu,dashboardItem);
      libgtk.gtk_widget_show_all(dashboardItem);
      libgtk.gdk_threads_leave();
      menuEntry=new MenuEntry();
      menuEntry.dashboardItem=dashboardItem;
      menuEntry.gtkCallback=gtkCallback;
      this.menuEntries.put(menuText,menuEntry);
    }
 else {
      updateMenuEntry(menuText,menuText,callback);
    }
  }
}
Program: 96400
Project: 96400
Buggy source:
@Override public void setStatus(String infoString,String iconName){
  if (this.connectionStatusItem == null) {
    this.connectionStatusItem=libgtk.gtk_menu_item_new_with_label(infoString);
    this.widgets.add(this.connectionStatusItem);
    libgtk.gtk_widget_set_sensitive(this.connectionStatusItem,Gtk.FALSE);
    libgtk.gtk_menu_shell_append(this.menu,this.connectionStatusItem);
  }
 else {
    libgtk.gtk_menu_item_set_label(this.connectionStatusItem,infoString);
  }
  libgtk.gtk_widget_show_all(this.connectionStatusItem);
  libappindicator.app_indicator_set_icon_full(this.appIndicator,iconPath(iconName),this.appName);
}

Fixed version (ground truth):
@Override public void setStatus(String infoString,String iconName){
  libgtk.gdk_threads_enter();
  if (this.connectionStatusItem == null) {
    this.connectionStatusItem=libgtk.gtk_menu_item_new_with_label(infoString);
    this.widgets.add(this.connectionStatusItem);
    libgtk.gtk_widget_set_sensitive(this.connectionStatusItem,Gtk.FALSE);
    libgtk.gtk_menu_shell_append(this.menu,this.connectionStatusItem);
  }
 else {
    libgtk.gtk_menu_item_set_label(this.connectionStatusItem,infoString);
  }
  libgtk.gtk_widget_show_all(this.connectionStatusItem);
  libappindicator.app_indicator_set_icon_full(this.appIndicator,iconPath(iconName),this.appName);
  libgtk.gdk_threads_leave();
}
Program: 96401
Project: 96401
Buggy source:
@Override public void removeTray(){
  for (  Pointer widget : this.widgets) {
    libgtk.gtk_widget_destroy(widget);
  }
  libgtk.gtk_status_icon_set_visible(this.trayIcon,false);
  libgobject.g_object_unref(this.trayIcon);
  this.active=false;
  this.trayIcon=null;
  this.widgets.clear();
synchronized (this.menuEntries) {
    this.menuEntries.clear();
  }
  this.jmenu.setVisible(false);
  this.jmenu.setEnabled(false);
  this.jmenu=null;
  this.connectionStatusItem=null;
  super.removeTray();
}

Fixed version (ground truth):
@Override public void removeTray(){
  libgtk.gdk_threads_enter();
  for (  Pointer widget : this.widgets) {
    libgtk.gtk_widget_destroy(widget);
  }
  libgtk.gtk_status_icon_set_visible(this.trayIcon,false);
  libgobject.g_object_unref(this.trayIcon);
  this.active=false;
  this.trayIcon=null;
  this.widgets.clear();
synchronized (this.menuEntries) {
    this.menuEntries.clear();
  }
  this.jmenu.setVisible(false);
  this.jmenu.setEnabled(false);
  this.jmenu=null;
  this.connectionStatusItem=null;
  libgtk.gtk_main_quit();
  libgtk.gdk_threads_leave();
  super.removeTray();
}
Program: 96402
Project: 96402
Buggy source:
/** 
 * Will update an already existing menu entry (or add a new one, if it doesn't exist)
 */
@Override public void updateMenuEntry(final String origMenuText,final String newMenuText,final SystemTrayMenuAction newCallback){
  Runnable doRun=new Runnable(){
    @Override public void run(){
      Map<String,JMenuItem> menuEntries2=GtkSystemTray.this.menuEntries;
synchronized (menuEntries2) {
        JMenuItem menuEntry=menuEntries2.get(origMenuText);
        if (menuEntry != null) {
          ActionListener[] actionListeners=menuEntry.getActionListeners();
          for (          ActionListener l : actionListeners) {
            menuEntry.removeActionListener(l);
          }
          menuEntry.addActionListener(new ActionListener(){
            @Override public void actionPerformed(            ActionEvent e){
              GtkSystemTray.this.callbackExecutor.execute(new Runnable(){
                @Override public void run(){
                  newCallback.onClick(GtkSystemTray.this);
                }
              }
);
            }
          }
);
          menuEntry.setText(newMenuText);
          menuEntry.revalidate();
        }
 else {
          addMenuEntry(origMenuText,newCallback);
        }
      }
    }
  }
;
  if (SwingUtilities.isEventDispatchThread()) {
    doRun.run();
  }
 else {
    try {
      SwingUtilities.invokeAndWait(doRun);
    }
 catch (    InvocationTargetException e) {
      logger.error("String_Node_Str",e);
    }
catch (    InterruptedException e) {
      logger.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Will update an already existing menu entry (or add a new one, if it doesn't exist)
 */
@Override public void updateMenuEntry(final String origMenuText,final String newMenuText,final SystemTrayMenuAction newCallback){
  SwingUtil.invokeAndWait(new Runnable(){
    @Override public void run(){
      Map<String,JMenuItem> menuEntries2=GtkSystemTray.this.menuEntries;
synchronized (menuEntries2) {
        JMenuItem menuEntry=menuEntries2.get(origMenuText);
        if (menuEntry != null) {
          ActionListener[] actionListeners=menuEntry.getActionListeners();
          for (          ActionListener l : actionListeners) {
            menuEntry.removeActionListener(l);
          }
          menuEntry.addActionListener(new ActionListener(){
            @Override public void actionPerformed(            ActionEvent e){
              GtkSystemTray.this.callbackExecutor.execute(new Runnable(){
                @Override public void run(){
                  newCallback.onClick(GtkSystemTray.this);
                }
              }
);
            }
          }
);
          menuEntry.setText(newMenuText);
          menuEntry.revalidate();
        }
 else {
          addMenuEntry(origMenuText,newCallback);
        }
      }
    }
  }
);
}
Program: 96403
Project: 96403
Buggy source:
/** 
 * Will add a new menu entry, or update one if it already exists
 */
@Override public void addMenuEntry(final String menuText,final SystemTrayMenuAction callback){
  Runnable doRun=new Runnable(){
    @Override public void run(){
      Map<String,JMenuItem> menuEntries2=GtkSystemTray.this.menuEntries;
synchronized (menuEntries2) {
        JMenuItem menuEntry=menuEntries2.get(menuText);
        if (menuEntry == null) {
          SystemTrayMenuPopup menu=GtkSystemTray.this.jmenu;
          menuEntry=new JMenuItem(menuText);
          menuEntry.addActionListener(new ActionListener(){
            @Override public void actionPerformed(            ActionEvent e){
              GtkSystemTray.this.callbackExecutor.execute(new Runnable(){
                @Override public void run(){
                  callback.onClick(GtkSystemTray.this);
                }
              }
);
            }
          }
);
          menu.add(menuEntry);
          menuEntries2.put(menuText,menuEntry);
        }
 else {
          updateMenuEntry(menuText,menuText,callback);
        }
      }
    }
  }
;
  if (SwingUtilities.isEventDispatchThread()) {
    doRun.run();
  }
 else {
    try {
      SwingUtilities.invokeAndWait(doRun);
    }
 catch (    InvocationTargetException e) {
      logger.error("String_Node_Str",e);
    }
catch (    InterruptedException e) {
      logger.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Will add a new menu entry, or update one if it already exists
 */
@Override public void addMenuEntry(final String menuText,final SystemTrayMenuAction callback){
  SwingUtil.invokeAndWait(new Runnable(){
    @Override public void run(){
      Map<String,JMenuItem> menuEntries2=GtkSystemTray.this.menuEntries;
synchronized (menuEntries2) {
        JMenuItem menuEntry=menuEntries2.get(menuText);
        if (menuEntry == null) {
          SystemTrayMenuPopup menu=GtkSystemTray.this.jmenu;
          menuEntry=new JMenuItem(menuText);
          menuEntry.addActionListener(new ActionListener(){
            @Override public void actionPerformed(            ActionEvent e){
              GtkSystemTray.this.callbackExecutor.execute(new Runnable(){
                @Override public void run(){
                  callback.onClick(GtkSystemTray.this);
                }
              }
);
            }
          }
);
          menu.add(menuEntry);
          menuEntries2.put(menuText,menuEntry);
        }
 else {
          updateMenuEntry(menuText,menuText,callback);
        }
      }
    }
  }
);
}
Program: 96404
Project: 96404
Buggy source:
@Override public void callback(Pointer instance,final GdkEventButton event){
  if (event.type == 4) {
    SwingUtilities.invokeLater(new Runnable(){
      @Override public void run(){
        if (GtkSystemTray.this.jmenu.isVisible()) {
          GtkSystemTray.this.jmenu.setVisible(false);
        }
 else {
          int iconX=(int)(event.x_root - event.x);
          int iconY=(int)(event.y_root - event.y);
          Dimension size=GtkSystemTray.this.jmenu.getPreferredSize();
          iconX-=size.width / 2;
          if (iconY > 240) {
            iconY-=size.height;
          }
 else {
            iconY+=ICON_SIZE;
          }
          GtkSystemTray.this.jmenu.setInvoker(GtkSystemTray.this.jmenu);
          GtkSystemTray.this.jmenu.setLocation(iconX,iconY);
          GtkSystemTray.this.jmenu.setVisible(true);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void callback(Pointer instance,final GdkEventButton event){
  if (event.type == 4) {
    SwingUtil.invokeLater(new Runnable(){
      @Override public void run(){
        if (GtkSystemTray.this.jmenu.isVisible()) {
          GtkSystemTray.this.jmenu.setVisible(false);
        }
 else {
          int iconX=(int)(event.x_root - event.x);
          int iconY=(int)(event.y_root - event.y);
          Dimension size=GtkSystemTray.this.jmenu.getPreferredSize();
          iconX-=size.width / 2;
          if (iconY > 240) {
            iconY-=size.height;
          }
 else {
            iconY+=ICON_SIZE;
          }
          GtkSystemTray.this.jmenu.setInvoker(GtkSystemTray.this.jmenu);
          GtkSystemTray.this.jmenu.setLocation(iconX,iconY);
          GtkSystemTray.this.jmenu.setVisible(true);
        }
      }
    }
);
  }
}
Program: 96406
Project: 96406
Buggy source:
@Override public void setStatus(final String infoString,String iconName){
  Runnable doRun=new Runnable(){
    @Override public void run(){
      if (GtkSystemTray.this.connectionStatusItem == null) {
        GtkSystemTray.this.connectionStatusItem=new JMenuItem(infoString);
        GtkSystemTray.this.connectionStatusItem.setEnabled(false);
        GtkSystemTray.this.jmenu.add(GtkSystemTray.this.connectionStatusItem);
      }
 else {
        GtkSystemTray.this.connectionStatusItem.setText(infoString);
      }
    }
  }
;
  if (SwingUtilities.isEventDispatchThread()) {
    doRun.run();
  }
 else {
    try {
      SwingUtilities.invokeAndWait(doRun);
    }
 catch (    InvocationTargetException e) {
      logger.error("String_Node_Str",e);
    }
catch (    InterruptedException e) {
      logger.error("String_Node_Str",e);
    }
  }
  libgtk.gtk_status_icon_set_from_file(GtkSystemTray.this.trayIcon,iconPath(iconName));
}

Fixed version (ground truth):
@Override public void setStatus(final String infoString,String iconName){
  SwingUtil.invokeAndWait(new Runnable(){
    @Override public void run(){
      if (GtkSystemTray.this.connectionStatusItem == null) {
        GtkSystemTray.this.connectionStatusItem=new JMenuItem(infoString);
        GtkSystemTray.this.connectionStatusItem.setEnabled(false);
        GtkSystemTray.this.jmenu.add(GtkSystemTray.this.connectionStatusItem);
      }
 else {
        GtkSystemTray.this.connectionStatusItem.setText(infoString);
      }
    }
  }
);
  libgtk.gdk_threads_enter();
  libgtk.gtk_status_icon_set_from_file(GtkSystemTray.this.trayIcon,iconPath(iconName));
  libgtk.gdk_threads_leave();
}
Program: 96407
Project: 96407
Buggy source:
public abstract void removeTray();

Fixed version (ground truth):
public void removeTray(){
  SystemTray.this.callbackExecutor.shutdown();
}
Program: 96408
Project: 96408
Buggy source:
@Override public void removeTray(){
  for (  Pointer widget : this.widgets) {
    libgtk.gtk_widget_destroy(widget);
  }
  libappindicator.app_indicator_set_status(this.appIndicator,AppIndicator.STATUS_PASSIVE);
  this.appIndicator.write();
  Pointer p=this.appIndicator.getPointer();
  libgobject.g_object_unref(p);
  this.active=false;
  this.appIndicator=null;
  this.widgets.clear();
  libgobject.g_object_unref(this.menu);
  this.menu=null;
synchronized (this.menuEntries) {
    this.menuEntries.clear();
  }
  this.connectionStatusItem=null;
}

Fixed version (ground truth):
@Override public void removeTray(){
  for (  Pointer widget : this.widgets) {
    libgtk.gtk_widget_destroy(widget);
  }
  libappindicator.app_indicator_set_status(this.appIndicator,AppIndicator.STATUS_PASSIVE);
  this.appIndicator.write();
  Pointer p=this.appIndicator.getPointer();
  libgobject.g_object_unref(p);
  this.active=false;
  this.appIndicator=null;
  this.widgets.clear();
  libgobject.g_object_unref(this.menu);
  this.menu=null;
synchronized (this.menuEntries) {
    this.menuEntries.clear();
  }
  this.connectionStatusItem=null;
  super.removeTray();
}
Program: 96410
Project: 96410
Buggy source:
@Override public void removeTray(){
  for (  Pointer widget : this.widgets) {
    libgtk.gtk_widget_destroy(widget);
  }
  libgtk.gtk_status_icon_set_visible(this.trayIcon,false);
  libgobject.g_object_unref(this.trayIcon);
  this.active=false;
  this.trayIcon=null;
  this.widgets.clear();
synchronized (this.menuEntries) {
    this.menuEntries.clear();
  }
  this.jmenu.setVisible(false);
  this.jmenu.setEnabled(false);
  this.jmenu=null;
  this.connectionStatusItem=null;
}

Fixed version (ground truth):
@Override public void removeTray(){
  for (  Pointer widget : this.widgets) {
    libgtk.gtk_widget_destroy(widget);
  }
  libgtk.gtk_status_icon_set_visible(this.trayIcon,false);
  libgobject.g_object_unref(this.trayIcon);
  this.active=false;
  this.trayIcon=null;
  this.widgets.clear();
synchronized (this.menuEntries) {
    this.menuEntries.clear();
  }
  this.jmenu.setVisible(false);
  this.jmenu.setEnabled(false);
  this.jmenu=null;
  this.connectionStatusItem=null;
  super.removeTray();
}
Program: 96412
Project: 96412
Buggy source:
@Override public void removeTray(){
  Runnable doRun=new Runnable(){
    @Override public void run(){
      SwingSystemTray.this.tray.remove(SwingSystemTray.this.trayIcon);
      SwingSystemTray.this.menuEntries.clear();
    }
  }
;
  if (SwingUtilities.isEventDispatchThread()) {
    doRun.run();
  }
 else {
    try {
      SwingUtilities.invokeAndWait(doRun);
    }
 catch (    InvocationTargetException e) {
      logger.error("String_Node_Str",e);
    }
catch (    InterruptedException e) {
      logger.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void removeTray(){
  Runnable doRun=new Runnable(){
    @Override public void run(){
      SwingSystemTray.this.tray.remove(SwingSystemTray.this.trayIcon);
      SwingSystemTray.this.menuEntries.clear();
    }
  }
;
  if (SwingUtilities.isEventDispatchThread()) {
    doRun.run();
  }
 else {
    try {
      SwingUtilities.invokeAndWait(doRun);
    }
 catch (    InvocationTargetException e) {
      logger.error("String_Node_Str",e);
    }
catch (    InterruptedException e) {
      logger.error("String_Node_Str",e);
    }
  }
  super.removeTray();
}
Program: 96413
Project: 96413
Buggy source:
public Project(ProjectInfo projInfo,Task rootTask){
  setId(rootTask.getId());
  setName(rootTask.getName());
  setCompletionDate(rootTask.getCompletionDate());
  setDeferDate(rootTask.getDeferDate());
  setDueDate(rootTask.getDueDate());
  setFlagged(rootTask.isFlagged());
  setNote(rootTask.getNote());
  setRank(rootTask.getRank());
  setSequential(rootTask.isSequential());
  status=projInfo.getStatus();
  for (  Task childOfRootTask : new LinkedList<>(rootTask.getTasks())) {
    add(childOfRootTask);
  }
  rootTask.setIsProjectTask(true);
  rootTask.setParent(this);
}

Fixed version (ground truth):
public Project(ProjectInfo projInfo,Task rootTask){
  setId(rootTask.getId());
  setName(rootTask.getName());
  setCompletionDate(rootTask.getCompletionDate());
  setDeferDate(rootTask.getDeferDate());
  setDueDate(rootTask.getDueDate());
  setFlagged(rootTask.isFlagged());
  setNote(rootTask.getNote());
  setRank(rootTask.getRank());
  setSequential(rootTask.isSequential());
  status=projInfo.getStatus();
  singleActionList=projInfo.isSingleActionList();
  for (  Task childOfRootTask : new LinkedList<>(rootTask.getTasks())) {
    add(childOfRootTask);
  }
  rootTask.setIsProjectTask(true);
  rootTask.setParent(this);
}
Program: 96414
Project: 96414
Buggy source:
@Override @ExprAttribute(help="String_Node_Str") public boolean isAvailable(){
  boolean available=!isCompleted() && !isBlocked();
  if (available && parent != null) {
    available=available && parent.isAvailable();
  }
  if (available && context != null) {
    available=available && context.isAvailable();
  }
  return available;
}

Fixed version (ground truth):
@Override @ExprAttribute(help="String_Node_Str") public boolean isAvailable(){
  boolean available=!isCompleted() && !isBlocked();
  if (available && parent != null) {
    available=available && parent.isAvailable();
  }
  if (available && isProject) {
    if (((Project)parent).getUncompletedTaskCount() == 0 && !((Project)parent).isSingleActionList()) {
      available=true;
    }
 else {
      available=false;
    }
  }
  if (available && context != null) {
    available=available && context.isAvailable();
  }
  return available;
}
Program: 96415
Project: 96415
Buggy source:
@Override @JsonIgnore public List<Node> getProjectPath(){
  if (parent != null) {
    return getProjectPath(parent);
  }
 else   if (project != null) {
    return getProjectPath(project);
  }
 else {
    LinkedList<Node> result=new LinkedList<>();
    result.add(this);
    return result;
  }
}

Fixed version (ground truth):
@Override @JsonIgnore public List<Node> getProjectPath(){
  if (parent != null) {
    return getProjectPath(parent);
  }
 else {
    LinkedList<Node> result=new LinkedList<>();
    result.add(this);
    return result;
  }
}
Program: 96419
Project: 96419
Buggy source:
private void createCameraView(){
  cameraView=new CameraView(subScene);
  cameraView.setFitWidth(250);
  cameraView.setFitHeight(200);
  cameraView.setFirstPersonNavigationEabled(true);
  cameraView.setFocusTraversable(true);
  cameraView.getCamera().setTranslateZ(-2500);
  cameraView.getCamera().setTranslateX(500);
  StackPane.setAlignment(cameraView,Pos.BOTTOM_RIGHT);
  StackPane.setMargin(cameraView,new Insets(10));
  mainPane.getChildren().add(cameraView);
  cameraView.startViewing();
}

Fixed version (ground truth):
private void createCameraView(){
  cameraView=new CameraView(subScene);
  cameraView.setFitWidth(250);
  cameraView.setFitHeight(200);
  cameraView.setFirstPersonNavigationEabled(true);
  cameraView.setFocusTraversable(true);
  cameraView.getCamera().setTranslateZ(-2500);
  cameraView.getCamera().setTranslateX(500);
  StackPane.setAlignment(cameraView,Pos.BOTTOM_RIGHT);
  StackPane.setMargin(cameraView,new Insets(20));
  mainPane.getChildren().add(cameraView);
  cameraView.startViewing();
}
Program: 96421
Project: 96421
Buggy source:
protected void changeContent(){
  if (selectedSample == null) {
    return;
  }
  rightSideContent.getChildren().clear();
  if (!centerContent.getChildren().isEmpty()) {
    centerContent.getChildren().clear();
  }
  updateContent();
}

Fixed version (ground truth):
protected void changeContent(){
  if (selectedSample == null) {
    return;
  }
  contentControls.getChildren().clear();
  if (!centerContent.getChildren().isEmpty()) {
    centerContent.getChildren().clear();
  }
  updateContent();
}
Program: 96422
Project: 96422
Buggy source:
private void updateContent(){
  centerContent.getChildren().addAll(buildSampleContent(selectedSample));
  centerContent.toBack();
  Node controls=selectedSample.getControlPanel();
  if (controls != null) {
    VBox.setVgrow(controls,Priority.ALWAYS);
    rightSideContent.getChildren().addAll(controls);
    client.setPinnedSide(Side.RIGHT);
    frame.getPinRelease().toFront();
    System.out.println(client.getRight().getOnMouseReleased());
  }
 else {
    frame.getPinRelease().toBack();
  }
}

Fixed version (ground truth):
private void updateContent(){
  HBox cPane=new HBox();
  cPane.setPrefSize(USE_COMPUTED_SIZE,USE_COMPUTED_SIZE);
  Node content=buildSampleContent(selectedSample);
  HBox.setHgrow(content,Priority.ALWAYS);
  Node controls=selectedSample.getControlPanel();
  if (controls != null) {
    contentControls.getChildren().add(controls);
    VBox.setVgrow(controls,Priority.ALWAYS);
  }
  cPane.getChildren().addAll(content,contentControls);
  centerContent.getChildren().addAll(cPane);
  centerContent.toBack();
}
Program: 96423
Project: 96423
Buggy source:
private void initWindowControls(){
  sceneProperty().addListener(i -> {
    if (getScene() != null) {
      getScene().setOnMousePressed(e -> {
        mOX=mX;
        mOY=mY;
        mX=e.getSceneX();
        mY=e.getSceneY();
        mDX=mX - mOX;
        mDY=mY - mOY;
      }
);
    }
  }
);
  headerSpacer.setOnMouseDragged((e) -> {
    stage.setX(e.getScreenX() - mX);
    stage.setY(e.getScreenY() - mY);
  }
);
  southEastResize.setOnMouseEntered(e -> e.consume());
  southEastResize.setOnMouseExited(e -> e.consume());
  southEastResize.setOnMousePressed((e) -> {
    dragOffsetX=(getTranslateX() + getWidth() - e.getScreenX());
    dragOffsetY=(getTranslateY() + getHeight() - e.getScreenY());
  }
);
  southEastResize.setOnMouseDragged((e) -> {
    double x=e.getScreenX() + dragOffsetX, y=e.getScreenY() + dragOffsetY;
    double w=x - getTranslateX();
    double h=y - getTranslateY();
    setPrefWidth(Math.max(stageMinWidth,w));
    setPrefHeight(Math.max(stageMinHeight,h));
    Platform.runLater(() -> stage.sizeToScene());
  }
);
}

Fixed version (ground truth):
private void initWindowControls(){
  sceneProperty().addListener(i -> {
    if (getScene() != null) {
      getScene().setOnMousePressed(e -> {
        mOX=mX;
        mOY=mY;
        mX=e.getSceneX();
        mY=e.getSceneY();
        mDX=mX - mOX;
        mDY=mY - mOY;
      }
);
    }
  }
);
  headerBar.setOnMouseDragged((e) -> {
    stage.setX(e.getScreenX() - mX);
    stage.setY(e.getScreenY() - mY);
  }
);
}
Program: 96424
Project: 96424
Buggy source:
public SimpleWindowFrame(Stage stage,double minWidth,double minHeight){
  try {
    FXMLLoader loader=new FXMLLoader(this.getClass().getResource("String_Node_Str"));
    loader.setController(SimpleWindowFrame.this);
    loader.setRoot(SimpleWindowFrame.this);
    loader.load();
  }
 catch (  IOException ex) {
    Logger.getLogger(CustomWindow.class.getName()).log(Level.SEVERE,null,ex);
  }
  this.stage=stage;
  this.stageMinWidth=minWidth;
  this.stageMinHeight=minHeight;
  initWindowControls();
  minimize.setOnAction(a -> {
    stage.setIconified(true);
  }
);
  maximize.setOnAction(a -> {
    if (!stage.isMaximized()) {
      stage.setMaximized(true);
    }
 else {
      stage.setMaximized(false);
    }
  }
);
  exit.setOnAction(a -> Platform.exit());
  pinRelease.toBack();
}

Fixed version (ground truth):
public SimpleWindowFrame(Stage stage,double minWidth,double minHeight){
  try {
    FXMLLoader loader=new FXMLLoader(this.getClass().getResource("String_Node_Str"));
    loader.setController(SimpleWindowFrame.this);
    loader.setRoot(SimpleWindowFrame.this);
    loader.load();
  }
 catch (  IOException ex) {
    Logger.getLogger(CustomWindow.class.getName()).log(Level.SEVERE,null,ex);
  }
  this.stage=stage;
  this.stageMinWidth=minWidth;
  this.stageMinHeight=minHeight;
  initWindowControls();
  minimize.setOnAction(a -> {
    stage.setIconified(true);
  }
);
  maximize.setOnAction(a -> {
    if (!stage.isMaximized()) {
      stage.setMaximized(true);
    }
 else {
      stage.setMaximized(false);
    }
  }
);
  exit.setOnAction(a -> Platform.exit());
}
Program: 96425
Project: 96425
Buggy source:
public ControlPanel(ControlCategory cat){
  this();
  this.accordion.getPanes().add(cat);
  this.getChildren().add(accordion);
}

Fixed version (ground truth):
public ControlPanel(ControlCategory cat){
  this();
  this.accordion.getPanes().add(cat);
  this.getChildren().add(accordion);
  this.getStyleClass().clear();
}
Program: 96426
Project: 96426
Buggy source:
@Test public void testNoJMXBindingNameConflictsOnMultiServicesUsingSameConnect() throws Exception {
  GatewayConfigurationBuilder configBuilder=new GatewayConfigurationBuilder();
  GatewayConfiguration gatewayConfiguration=configBuilder.service().name("String_Node_Str").accept(FRONTEND_URI_1).connect(BACKEND_URI_1).type(PROXY).done().service().accept(FRONTEND_URI_2).connect(BACKEND_URI_1).type(PROXY).done().done();
  Gateway gateway=new Gateway();
  try {
    gateway.start(gatewayConfiguration);
  }
  finally {
    gateway.stop();
  }
}

Fixed version (ground truth):
@Test public void testNoJMXBindingNameConflictsOnMultiServicesUsingSameConnect() throws Exception {
  GatewayConfigurationBuilder configBuilder=new GatewayConfigurationBuilder();
  GatewayConfiguration gatewayConfiguration=configBuilder.service().name("String_Node_Str").accept(FRONTEND_URI_1).connect(BACKEND_URI_1).type(PROXY).done().service().accept(FRONTEND_URI_2).connect(BACKEND_URI_1).type(PROXY).done().done();
  Gateway gateway=new Gateway();
  try {
    gateway.start(gatewayConfiguration);
  }
  finally {
    Thread.sleep(500);
    gateway.stop();
  }
}
Program: 96427
Project: 96427
Buggy source:
@Specification("String_Node_Str") @ScriptProperty("String_Node_Str") @Test public void sessionWhichHasClosedShouldBeRemovedFromCurrentSessionCountAndActiveSessions() throws Exception {
  k3po.finish();
  Thread.sleep(1000);
  MBeanServerConnection mbeanServerConn=jmxConnection.getConnection();
  ObjectName summaryBeansObjectNamePattern=new ObjectName("String_Node_Str" + ECHO_WSN_SERVICE + "String_Node_Str");
  Set<ObjectName> mbeanNames=mbeanServerConn.queryNames(summaryBeansObjectNamePattern,null);
  assertEquals(1,mbeanNames.size());
  ObjectName summaryBean=mbeanNames.iterator().next();
  assertEquals(Long.valueOf(1),(Long)mbeanServerConn.getAttribute(summaryBean,"String_Node_Str"));
  assertEquals(Long.valueOf(0),(Long)mbeanServerConn.getAttribute(summaryBean,"String_Node_Str"));
  mbeanNames=mbeanServerConn.queryNames(ObjectName.getInstance("String_Node_Str"),null);
  assertEquals("String_Node_Str",0,mbeanNames.size());
}

Fixed version (ground truth):
@Specification("String_Node_Str") @ScriptProperty("String_Node_Str") @Test public void sessionWhichHasClosedShouldBeRemovedFromCurrentSessionCountAndActiveSessions() throws Exception {
  k3po.finish();
  Thread.sleep(1000);
  MBeanServerConnection mbeanServerConn=jmxConnection.getConnection();
  ObjectName summaryBeansObjectNamePattern=new ObjectName("String_Node_Str" + ECHO_WSN_SERVICE + "String_Node_Str");
  Set<ObjectName> mbeanNames=mbeanServerConn.queryNames(summaryBeansObjectNamePattern,null);
  assertEquals(1,mbeanNames.size());
  ObjectName summaryBean=mbeanNames.iterator().next();
  assertEquals(Long.valueOf(1),(Long)mbeanServerConn.getAttribute(summaryBean,"String_Node_Str"));
  assertEquals(Long.valueOf(0),(Long)mbeanServerConn.getAttribute(summaryBean,"String_Node_Str"));
  long startTime=currentTimeMillis();
  int sessionsCount=1;
  while (sessionsCount > 0 && (currentTimeMillis() - startTime) < 10000) {
    Thread.sleep(500);
    mbeanNames=mbeanServerConn.queryNames(ObjectName.getInstance("String_Node_Str"),null);
    sessionsCount=mbeanNames.size();
  }
  assertEquals("String_Node_Str",0,sessionsCount);
}
Program: 96428
Project: 96428
Buggy source:
@Specification({"String_Node_Str","String_Node_Str","String_Node_Str"}) @Test public void sessionAttributePrincipalsShouldListUserPrincipals() throws Exception {
  k3po.finish();
  MBeanServerConnection mbeanServerConn=jmxConnection.getConnection();
  Set<ObjectName> mbeanNames=mbeanServerConn.queryNames(ObjectName.getInstance("String_Node_Str"),null);
  for (  ObjectName name : mbeanNames) {
    String principals=(String)mbeanServerConn.getAttribute(name,"String_Node_Str");
    System.out.println(format("String_Node_Str",name,principals));
    assertTrue(format("String_Node_Str",name,principals),principals.contains("String_Node_Str"));
    assertTrue(format("String_Node_Str",name,principals),principals.contains("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Specification({"String_Node_Str","String_Node_Str","String_Node_Str"}) @Test public void sessionAttributePrincipalsShouldListUserPrincipals() throws Exception {
  k3po.finish();
  MBeanServerConnection mbeanServerConn=jmxConnection.getConnection();
  Set<ObjectName> mbeanNames=mbeanServerConn.queryNames(ObjectName.getInstance("String_Node_Str"),null);
  long startTime=currentTimeMillis();
  boolean gotAllPrincipals=false;
  while (!gotAllPrincipals && (currentTimeMillis() - startTime) < 10000) {
    Thread.sleep(500);
    gotAllPrincipals=true;
    for (    ObjectName name : mbeanNames) {
      if (mbeanServerConn.getAttribute(name,"String_Node_Str") == null) {
        gotAllPrincipals=false;
        break;
      }
    }
  }
  assertTrue("String_Node_Str",gotAllPrincipals);
  for (  ObjectName name : mbeanNames) {
    String principals=(String)mbeanServerConn.getAttribute(name,"String_Node_Str");
    System.out.println(format("String_Node_Str",name,principals));
    assertTrue(format("String_Node_Str",name,principals),principals.contains("String_Node_Str"));
    assertTrue(format("String_Node_Str",name,principals),principals.contains("String_Node_Str"));
  }
  shouldCloseSessionsByRolePrincipal("String_Node_Str");
}
Program: 96429
Project: 96429
Buggy source:
public void deregister(final AbstractNioChannel<?> channel){
  registerTask(new Runnable(){
    @Override public void run(){
      SelectionKey key=channel.channel.keyFor(selector);
      if (key != null) {
        key.cancel();
        increaseCancelledKeys();
        try {
          selector.selectNow();
        }
 catch (        IOException e) {
        }
        if (wakenUp.compareAndSet(false,true)) {
          selector.wakeup();
        }
      }
    }
  }
);
}

Fixed version (ground truth):
public void deregister(final AbstractNioChannel<?> channel){
  if (channel instanceof NioChildDatagramChannel) {
    return;
  }
  registerTask(new Runnable(){
    @Override public void run(){
      SelectionKey key=channel.channel.keyFor(selector);
      if (key != null) {
        key.cancel();
        increaseCancelledKeys();
        try {
          selector.selectNow();
        }
 catch (        IOException e) {
        }
        if (wakenUp.compareAndSet(false,true)) {
          selector.wakeup();
        }
      }
    }
  }
);
}
Program: 96430
Project: 96430
Buggy source:
public void register(final AbstractNioChannel<?> channel){
  registerTask(new Runnable(){
    @Override public void run(){
      try {
        int interestOps=channel.getInternalInterestOps();
        interestOps|=SelectionKey.OP_WRITE;
        channel.setInternalInterestOps(interestOps);
        ReadDispatcher readDispatcher=channel instanceof NioSocketChannel ? new TcpReadDispatcher((NioSocketChannel)channel) : new UdpReadDispatcher((NioDatagramChannel)channel);
        channel.channel.register(selector,interestOps,readDispatcher);
      }
 catch (      ClosedChannelException e) {
        close(channel,succeededFuture(channel));
      }
    }
  }
);
}

Fixed version (ground truth):
public void register(final AbstractNioChannel<?> channel){
  if (channel instanceof NioChildDatagramChannel) {
    return;
  }
  registerTask(new Runnable(){
    @Override public void run(){
      try {
        int interestOps=channel.getInternalInterestOps();
        interestOps|=SelectionKey.OP_WRITE;
        channel.setInternalInterestOps(interestOps);
        ReadDispatcher readDispatcher=channel instanceof NioSocketChannel ? new TcpReadDispatcher((NioSocketChannel)channel) : new UdpReadDispatcher((NioDatagramChannel)channel);
        channel.channel.register(selector,interestOps,readDispatcher);
      }
 catch (      ClosedChannelException e) {
        close(channel,succeededFuture(channel));
      }
    }
  }
);
}
Program: 96431
Project: 96431
Buggy source:
@Test public void shouldLogMessageIncludingSession() throws Exception {
  IoSession session=context.mock(IoSession.class,"String_Node_Str");
  new DefaultExceptionMonitor().exceptionCaught(new NullPointerException(EXCEPTION_MESSAGE),session);
  expectedPatterns=Arrays.asList("String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldLogMessageIncludingSession() throws Exception {
  IoSession session=context.mock(IoSession.class,"String_Node_Str");
  new DefaultExceptionMonitor().exceptionCaught(new NullPointerException(EXCEPTION_MESSAGE),session);
  checkLogMessageRule.setExpectedPatterns(Arrays.asList("String_Node_Str"));
}
Program: 96432
Project: 96432
Buggy source:
public HttpProxyLoggingWarnIT(String serviceName,String expectedMessage){
  this.serviceName=serviceName;
  this.expectedMessage=expectedMessage;
  this.chain=RuleChain.outerRule(new MethodExecutionTrace()).around(robot).around(checkLogMessageRule).around(getGatewayRule());
}

Fixed version (ground truth):
public HttpProxyLoggingWarnIT(String serviceName,String expectedMessage){
  this.serviceName=serviceName;
  this.expectedMessage=expectedMessage;
  this.chain=RuleChain.outerRule(new MethodExecutionTrace()).around(getGatewayRule()).around(checkLogMessageRule).around(robot);
}
Program: 96433
Project: 96433
Buggy source:
@Specification("String_Node_Str") @Test public void sendHttp_1_0_Request() throws Exception {
  robot.finish();
  expectedPatterns=new ArrayList<String>(Arrays.asList(new String[]{expectedMessage}));
}

Fixed version (ground truth):
@Specification("String_Node_Str") @Test public void sendHttp_1_0_Request() throws Exception {
  robot.finish();
  checkLogMessageRule.setExpectedPatterns(Arrays.asList(new String[]{expectedMessage}));
}
Program: 96434
Project: 96434
Buggy source:
@Specification("String_Node_Str") @Test public void testRequestWithRCWithFailingFormat() throws Exception {
  task.run();
  k3po.finish();
  expectedPatterns=new ArrayList<>(Arrays.asList(new String[]{"String_Node_Str"}));
}

Fixed version (ground truth):
@Specification("String_Node_Str") @Test public void testRequestWithRCWithFailingFormat() throws Exception {
  task.run();
  k3po.finish();
  checkLogMessageRule.setExpectedPatterns(new ArrayList<>(Arrays.asList(new String[]{"String_Node_Str"})));
}
Program: 96435
Project: 96435
Buggy source:
@Override protected void doSessionOpened(IoSessionEx session) throws Exception {
  writeStringMessageToSession("String_Node_Str" + counter,session);
  InetSocketAddress socketAddress=(InetSocketAddress)session.getLocalAddress();
  expectedPatterns=Arrays.asList(String.format("String_Node_Str",session.getId(),socketAddress.getPort()));
}

Fixed version (ground truth):
@Override protected void doSessionOpened(IoSessionEx session) throws Exception {
  writeStringMessageToSession("String_Node_Str" + counter,session);
  InetSocketAddress socketAddress=(InetSocketAddress)session.getLocalAddress();
  checkLogMessageRule.setExpectedPatterns(Arrays.asList(String.format("String_Node_Str",session.getId(),socketAddress.getPort())));
}