Program: 96269
Project: 96269
Buggy source:
/** 
 * Waits for the GUI to finish loading
 */
public static void waitForStartup(){
  final CountDownLatch blockUntilStarted=new CountDownLatch(1);
  dispatch(new Runnable(){
    @Override public void run(){
      blockUntilStarted.countDown();
    }
  }
);
  if (SystemTray.isJavaFxLoaded) {
    if (!JavaFX.isEventThread()) {
      try {
        while (true) {
          Thread.sleep(100);
synchronized (gtkCallbacks) {
            if (gtkCallbacks.isEmpty()) {
              break;
            }
          }
        }
        if (!blockUntilStarted.await(10,TimeUnit.SECONDS)) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",new RuntimeException());
          }
        }
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
 else   if (SystemTray.isSwtLoaded) {
    if (!Swt.isEventThread()) {
      try {
        while (true) {
          Thread.sleep(100);
synchronized (gtkCallbacks) {
            if (gtkCallbacks.isEmpty()) {
              break;
            }
          }
        }
        if (!blockUntilStarted.await(10,TimeUnit.SECONDS)) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",new RuntimeException());
          }
        }
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
 else {
    try {
      while (true) {
        Thread.sleep(100);
synchronized (gtkCallbacks) {
          if (gtkCallbacks.isEmpty()) {
            break;
          }
        }
      }
      if (!blockUntilStarted.await(10,TimeUnit.SECONDS)) {
        if (SystemTray.DEBUG) {
          SystemTray.logger.error("String_Node_Str",new RuntimeException());
        }
      }
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Waits for the GUI to finish loading
 */
public static void waitForStartup(){
  final CountDownLatch blockUntilStarted=new CountDownLatch(1);
  dispatch(new Runnable(){
    @Override public void run(){
      blockUntilStarted.countDown();
    }
  }
);
  if (SystemTray.isJavaFxLoaded) {
    if (!JavaFX.isEventThread()) {
      try {
        while (true) {
          Thread.sleep(100);
synchronized (gtkCallbacks) {
            if (gtkCallbacks.isEmpty()) {
              break;
            }
          }
        }
        if (!blockUntilStarted.await(10,TimeUnit.SECONDS)) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",new Exception());
          }
        }
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
 else   if (SystemTray.isSwtLoaded) {
    if (!Swt.isEventThread()) {
      try {
        while (true) {
          Thread.sleep(100);
synchronized (gtkCallbacks) {
            if (gtkCallbacks.isEmpty()) {
              break;
            }
          }
        }
        if (!blockUntilStarted.await(10,TimeUnit.SECONDS)) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",new Exception());
          }
        }
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
 else {
    try {
      while (true) {
        Thread.sleep(100);
synchronized (gtkCallbacks) {
          if (gtkCallbacks.isEmpty()) {
            break;
          }
        }
      }
      if (!blockUntilStarted.await(10,TimeUnit.SECONDS)) {
        if (SystemTray.DEBUG) {
          SystemTray.logger.error("String_Node_Str",new Exception());
        }
      }
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
}