Program: 96411
Project: 96411
Buggy source:
@Override public void createTray(String iconName){
  this.trayIcon=libgtk.gtk_status_icon_new();
  libgtk.gtk_status_icon_set_from_file(this.trayIcon,iconPath(iconName));
  libgtk.gtk_status_icon_set_tooltip(this.trayIcon,this.appName);
  libgtk.gtk_status_icon_set_visible(this.trayIcon,true);
  Gobject.GEventCallback gtkCallback=new Gobject.GEventCallback(){
    @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);
            }
          }
        }
);
      }
    }
  }
;
  libgobject.g_signal_connect_data(this.trayIcon,"String_Node_Str",gtkCallback,null,null,0);
  if (!GtkSupport.usesSwtMainLoop) {
    this.gtkUpdateThread=new Thread(){
      @Override public void run(){
        try {
          libgtk.gtk_main();
        }
 catch (        Throwable t) {
          logger.warn("String_Node_Str",t);
        }
      }
    }
;
    this.gtkUpdateThread.setName("String_Node_Str");
    this.gtkUpdateThread.setDaemon(true);
    this.gtkUpdateThread.start();
  }
  try {
    SwingUtilities.invokeAndWait(new Runnable(){
      @Override public void run(){
        GtkSystemTray.this.jmenu=new SystemTrayMenuPopup();
      }
    }
);
  }
 catch (  InvocationTargetException e) {
    logger.error("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    logger.error("String_Node_Str",e);
  }
  this.active=true;
}

Fixed version (ground truth):
@Override public void createTray(String iconName){
  this.trayIcon=libgtk.gtk_status_icon_new();
  libgtk.gtk_status_icon_set_from_file(this.trayIcon,iconPath(iconName));
  libgtk.gtk_status_icon_set_tooltip(this.trayIcon,this.appName);
  libgtk.gtk_status_icon_set_visible(this.trayIcon,true);
  Gobject.GEventCallback gtkCallback=new Gobject.GEventCallback(){
    @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);
            }
          }
        }
);
      }
    }
  }
;
  libgobject.g_signal_connect_data(this.trayIcon,"String_Node_Str",gtkCallback,null,null,0);
  if (!GtkSupport.usesSwtMainLoop) {
    this.gtkUpdateThread=new Thread(){
      @Override public void run(){
        GtkSystemTray.this.blockUntilStarted.countDown();
        try {
          libgtk.gtk_main();
        }
 catch (        Throwable t) {
          logger.warn("String_Node_Str",t);
        }
      }
    }
;
    this.gtkUpdateThread.setName("String_Node_Str");
    this.gtkUpdateThread.setDaemon(true);
    this.gtkUpdateThread.start();
  }
  try {
    SwingUtilities.invokeAndWait(new Runnable(){
      @Override public void run(){
        GtkSystemTray.this.jmenu=new SystemTrayMenuPopup();
      }
    }
);
  }
 catch (  InvocationTargetException e) {
    logger.error("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    logger.error("String_Node_Str",e);
  }
  try {
    this.blockUntilStarted.await();
    this.active=true;
  }
 catch (  InterruptedException e) {
  }
}