Program: 96364
Project: 96364
Buggy source:
private static void init(){
  if (systemTray != null) {
    return;
  }
  if (GraphicsEnvironment.isHeadless()) {
    logger.error("String_Node_Str");
    throw new HeadlessException();
  }
  Class<? extends SystemTray> trayType=null;
  if (FORCE_LINUX_TYPE != SWING_INDICATOR && OS.isLinux()) {
    if (isSwtLoaded) {
      boolean isSwt_GTK3=!System.getProperty("String_Node_Str").equals("String_Node_Str");
      if (!isSwt_GTK3) {
        isSwt_GTK3=!System.getProperty("String_Node_Str").startsWith("String_Node_Str");
      }
      if (isSwt_GTK3 && FORCE_GTK2) {
        logger.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        throw new RuntimeException("String_Node_Str");
      }
 else       if (!isSwt_GTK3 && !FORCE_GTK2) {
        if (DEBUG) {
          logger.debug("String_Node_Str");
        }
        FORCE_GTK2=true;
      }
    }
 else     if (isJavaFxLoaded) {
      boolean isJFX_GTK3=System.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str");
      if (isJFX_GTK3 && FORCE_GTK2) {
        if (OS.javaVersion == 9) {
          logger.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          throw new RuntimeException("String_Node_Str");
        }
 else {
          logger.error("String_Node_Str" + "String_Node_Str");
          throw new RuntimeException("String_Node_Str");
        }
      }
 else       if (!isJFX_GTK3 && !FORCE_GTK2) {
        if (DEBUG) {
          logger.debug("String_Node_Str");
        }
        FORCE_GTK2=true;
      }
    }
  }
  if (DEBUG) {
switch (FORCE_LINUX_TYPE) {
case 1:
      logger.debug("String_Node_Str");
    break;
case 2:
  logger.debug("String_Node_Str");
break;
case 3:
logger.debug("String_Node_Str");
break;
default :
logger.debug("String_Node_Str");
break;
}
logger.debug("String_Node_Str",FORCE_GTK2);
}
if (OS.isWindows()) {
TRAY_SIZE-=4;
}
if (FORCE_LINUX_TYPE != SWING_INDICATOR && OS.isLinux()) {
if (Gtk.isGtk2 || AppIndicator.isVersion3) {
if (DEBUG) {
logger.trace("String_Node_Str");
}
}
if (SystemTray.FORCE_LINUX_TYPE == SystemTray.LINUX_GTK) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e1) {
if (DEBUG) {
logger.error("String_Node_Str",e1);
}
}
}
 else if (SystemTray.FORCE_LINUX_TYPE == SystemTray.LINUX_APP_INDICATOR) {
try {
trayType=AppIndicatorTray.class;
}
 catch (Throwable e1) {
if (DEBUG) {
logger.error("String_Node_Str",e1);
}
}
}
if (trayType == null) {
String XDG=System.getenv("String_Node_Str");
boolean isReallyGnome=false;
try {
ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream(8196);
PrintStream outputStream=new PrintStream(byteArrayOutputStream);
final ShellProcessBuilder shell=new ShellProcessBuilder(outputStream);
shell.setExecutable("String_Node_Str");
shell.addArgument("String_Node_Str");
shell.start();
String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
isReallyGnome=output.contains("String_Node_Str");
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
if (isReallyGnome) {
if (DEBUG) {
logger.error("String_Node_Str");
}
XDG="String_Node_Str";
}
if (DEBUG) {
logger.debug("String_Node_Str",XDG);
}
if ("String_Node_Str".equalsIgnoreCase(XDG)) {
try {
trayType=AppIndicatorTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(XDG)) {
try {
trayType=AppIndicatorTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e1) {
if (DEBUG) {
logger.error("String_Node_Str",e1);
}
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(XDG)) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(XDG)) {
isKDE=true;
try {
trayType=AppIndicatorTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(XDG)) {
String GDM=System.getenv("String_Node_Str");
if (DEBUG) {
logger.debug("String_Node_Str",GDM);
}
if ("String_Node_Str".equalsIgnoreCase(GDM)) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(GDM)) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(GDM)) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(GDM)) {
trayType=null;
GnomeShellExtension.SHELL_RESTART_COMMAND="String_Node_Str";
}
}
if (trayType == null) {
try {
ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream(8196);
PrintStream outputStream=new PrintStream(byteArrayOutputStream);
final ShellProcessBuilder shellVersion=new ShellProcessBuilder(outputStream);
shellVersion.setExecutable("String_Node_Str");
shellVersion.addArgument("String_Node_Str");
shellVersion.start();
String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
if (!output.isEmpty()) {
if (DEBUG) {
logger.info("String_Node_Str");
}
GnomeShellExtension.install(logger,output);
trayType=GtkSystemTray.class;
}
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
trayType=null;
}
}
}
if (trayType == null) {
BufferedReader bin=null;
try {
File proc=new File("String_Node_Str");
File[] listFiles=proc.listFiles();
if (listFiles != null) {
for (File procs : listFiles) {
String name=procs.getName();
if (!Character.isDigit(name.charAt(0))) {
continue;
}
File status=new File(procs,"String_Node_Str");
if (!status.canRead()) {
continue;
}
try {
bin=new BufferedReader(new FileReader(status));
String readLine=bin.readLine();
if (readLine != null && readLine.contains("String_Node_Str")) {
try {
  trayType=AppIndicatorTray.class;
}
 catch (Throwable e) {
  if (DEBUG) {
    logger.error("String_Node_Str",e);
  }
 else {
    logger.error("String_Node_Str");
  }
}
break;
}
}
  finally {
if (bin != null) {
try {
  bin.close();
}
 catch (Exception ignored) {
}
bin=null;
}
}
}
}
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
 finally {
if (bin != null) {
try {
bin.close();
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
}
}
if (trayType == null) {
trayType=GtkSystemTray.class;
logger.error("String_Node_Str" + "String_Node_Str");
}
}
if (trayType == null && java.awt.SystemTray.isSupported()) {
try {
java.awt.SystemTray.getSystemTray();
trayType=SwingSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
 else {
logger.error("String_Node_Str");
}
}
}
if (trayType == null) {
logger.error("String_Node_Str");
systemTray=null;
}
 else {
SystemTray systemTray_=null;
try {
ImageUtil.init();
if (OS.isLinux() && trayType == AppIndicatorTray.class && Gtk.isGtk2 && AppIndicator.isVersion3) {
try {
trayType=GtkSystemTray.class;
logger.warn("String_Node_Str" + "String_Node_Str");
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
logger.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
}
}
systemTray_=(SystemTray)trayType.getConstructors()[0].newInstance();
logger.info("String_Node_Str",trayType.getSimpleName());
}
 catch (NoSuchAlgorithmException e) {
logger.error("String_Node_Str");
}
catch (Exception e) {
logger.error("String_Node_Str" + trayType.getSimpleName() + "String_Node_Str",e);
}
systemTray=systemTray_;
if (ENABLE_SHUTDOWN_HOOK) {
if (isJavaFxLoaded) {
JavaFX.onShutdown(new Runnable(){
@Override public void run(){
if (systemTray != null) {
systemTray.shutdown();
}
}
}
);
}
 else if (isSwtLoaded) {
Swt.onShutdown(new Runnable(){
@Override public void run(){
if (systemTray != null) {
systemTray.shutdown();
}
}
}
);
}
}
}
}

Fixed version (ground truth):
private static void init(){
  if (systemTray != null) {
    return;
  }
  if (GraphicsEnvironment.isHeadless()) {
    logger.error("String_Node_Str");
    throw new HeadlessException();
  }
  Class<? extends SystemTray> trayType=null;
  if (DEBUG) {
    logger.debug("String_Node_Str",isJavaFxLoaded);
    logger.debug("String_Node_Str",isSwtLoaded);
  }
  if (FORCE_LINUX_TYPE != SWING_INDICATOR && OS.isLinux()) {
    if (isSwtLoaded) {
      boolean isSwt_GTK3=!System.getProperty("String_Node_Str").equals("String_Node_Str");
      if (!isSwt_GTK3) {
        isSwt_GTK3=!System.getProperty("String_Node_Str").startsWith("String_Node_Str");
      }
      if (isSwt_GTK3 && FORCE_GTK2) {
        logger.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        throw new RuntimeException("String_Node_Str");
      }
 else       if (!isSwt_GTK3 && !FORCE_GTK2) {
        if (DEBUG) {
          logger.debug("String_Node_Str");
        }
        FORCE_GTK2=true;
      }
    }
 else     if (isJavaFxLoaded) {
      boolean isJFX_GTK3=System.getProperty("String_Node_Str","String_Node_Str").equals("String_Node_Str");
      if (isJFX_GTK3 && FORCE_GTK2) {
        if (OS.javaVersion == 9) {
          logger.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          throw new RuntimeException("String_Node_Str");
        }
 else {
          logger.error("String_Node_Str" + "String_Node_Str");
          throw new RuntimeException("String_Node_Str");
        }
      }
 else       if (!isJFX_GTK3 && !FORCE_GTK2) {
        if (DEBUG) {
          logger.debug("String_Node_Str");
        }
        FORCE_GTK2=true;
      }
    }
  }
  if (DEBUG) {
switch (FORCE_LINUX_TYPE) {
case 1:
      logger.debug("String_Node_Str");
    break;
case 2:
  logger.debug("String_Node_Str");
break;
case 3:
logger.debug("String_Node_Str");
break;
default :
logger.debug("String_Node_Str");
break;
}
logger.debug("String_Node_Str",FORCE_GTK2);
}
if (OS.isWindows()) {
TRAY_SIZE-=4;
}
if (FORCE_LINUX_TYPE != SWING_INDICATOR && OS.isLinux()) {
if (Gtk.isGtk2 || AppIndicator.isVersion3) {
if (DEBUG) {
logger.trace("String_Node_Str");
}
}
if (SystemTray.FORCE_LINUX_TYPE == SystemTray.LINUX_GTK) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e1) {
if (DEBUG) {
logger.error("String_Node_Str",e1);
}
}
}
 else if (SystemTray.FORCE_LINUX_TYPE == SystemTray.LINUX_APP_INDICATOR) {
try {
trayType=AppIndicatorTray.class;
}
 catch (Throwable e1) {
if (DEBUG) {
logger.error("String_Node_Str",e1);
}
}
}
String XDG=System.getenv("String_Node_Str");
boolean isReallyGnome=false;
try {
ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream(8196);
PrintStream outputStream=new PrintStream(byteArrayOutputStream);
final ShellProcessBuilder shell=new ShellProcessBuilder(outputStream);
shell.setExecutable("String_Node_Str");
shell.addArgument("String_Node_Str");
shell.start();
String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
isReallyGnome=output.contains("String_Node_Str");
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
if (isReallyGnome) {
if (DEBUG) {
logger.error("String_Node_Str");
}
XDG="String_Node_Str";
}
if (DEBUG) {
logger.debug("String_Node_Str",XDG);
}
if ("String_Node_Str".equalsIgnoreCase(XDG)) {
try {
trayType=AppIndicatorTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(XDG)) {
try {
trayType=AppIndicatorTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e1) {
if (DEBUG) {
logger.error("String_Node_Str",e1);
}
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(XDG)) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(XDG)) {
isKDE=true;
try {
trayType=AppIndicatorTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(XDG)) {
String GDM=System.getenv("String_Node_Str");
if (DEBUG) {
logger.debug("String_Node_Str",GDM);
}
if ("String_Node_Str".equalsIgnoreCase(GDM)) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(GDM)) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(GDM)) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
 else if ("String_Node_Str".equalsIgnoreCase(GDM)) {
trayType=null;
GnomeShellExtension.SHELL_RESTART_COMMAND="String_Node_Str";
}
}
if (isReallyGnome) {
try {
ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream(8196);
PrintStream outputStream=new PrintStream(byteArrayOutputStream);
final ShellProcessBuilder shellVersion=new ShellProcessBuilder(outputStream);
shellVersion.setExecutable("String_Node_Str");
shellVersion.addArgument("String_Node_Str");
shellVersion.start();
String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
if (!output.isEmpty()) {
if (DEBUG) {
logger.info("String_Node_Str");
}
GnomeShellExtension.install(output);
if (trayType == null) {
trayType=GtkSystemTray.class;
}
}
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
if (trayType == null) {
BufferedReader bin=null;
try {
File proc=new File("String_Node_Str");
File[] listFiles=proc.listFiles();
if (listFiles != null) {
for (File procs : listFiles) {
String name=procs.getName();
if (!Character.isDigit(name.charAt(0))) {
continue;
}
File status=new File(procs,"String_Node_Str");
if (!status.canRead()) {
continue;
}
try {
bin=new BufferedReader(new FileReader(status));
String readLine=bin.readLine();
if (readLine != null && readLine.contains("String_Node_Str")) {
try {
  trayType=AppIndicatorTray.class;
}
 catch (Throwable e) {
  if (DEBUG) {
    logger.error("String_Node_Str",e);
  }
 else {
    logger.error("String_Node_Str");
  }
}
break;
}
}
  finally {
if (bin != null) {
try {
  bin.close();
}
 catch (Exception ignored) {
}
bin=null;
}
}
}
}
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
 finally {
if (bin != null) {
try {
bin.close();
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
}
}
}
if (trayType == null) {
trayType=GtkSystemTray.class;
logger.error("String_Node_Str" + "String_Node_Str");
}
}
if (trayType == null && java.awt.SystemTray.isSupported()) {
try {
java.awt.SystemTray.getSystemTray();
trayType=SwingSystemTray.class;
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
 else {
logger.error("String_Node_Str");
}
}
}
if (trayType == null) {
logger.error("String_Node_Str");
systemTray=null;
}
 else {
SystemTray systemTray_=null;
try {
ImageUtil.init();
if (OS.isLinux() && trayType == AppIndicatorTray.class && Gtk.isGtk2 && AppIndicator.isVersion3) {
try {
trayType=GtkSystemTray.class;
logger.warn("String_Node_Str" + "String_Node_Str");
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
logger.error("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
}
}
systemTray_=(SystemTray)trayType.getConstructors()[0].newInstance();
logger.info("String_Node_Str",trayType.getSimpleName());
}
 catch (NoSuchAlgorithmException e) {
logger.error("String_Node_Str");
}
catch (Exception e) {
logger.error("String_Node_Str" + trayType.getSimpleName() + "String_Node_Str",e);
}
systemTray=systemTray_;
if (ENABLE_SHUTDOWN_HOOK) {
if (isJavaFxLoaded) {
JavaFX.onShutdown(new Runnable(){
@Override public void run(){
if (systemTray != null) {
systemTray.shutdown();
}
}
}
);
}
 else if (isSwtLoaded) {
Swt.onShutdown(new Runnable(){
@Override public void run(){
if (systemTray != null) {
systemTray.shutdown();
}
}
}
);
}
}
}
}