Program: 96352
Project: 96352
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;
  boolean isKDE=false;
  if (DEBUG) {
    logger.debug("String_Node_Str",isJavaFxLoaded);
    logger.debug("String_Node_Str",isSwtLoaded);
  }
  if (FORCE_TRAY_TYPE != TYPE_SWING && OS.isLinux()) {
    if (isSwtLoaded) {
      String swt_gtk3=System.getProperty("String_Node_Str");
      boolean isSwt_GTK3=swt_gtk3 != null && !swt_gtk3.equals("String_Node_Str");
      if (!isSwt_GTK3) {
        String property=System.getProperty("String_Node_Str");
        isSwt_GTK3=property != null && !property.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_TRAY_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 (FORCE_TRAY_TYPE != TYPE_SWING && OS.isLinux()) {
if (Gtk.isGtk2 || AppIndicator.isVersion3) {
if (DEBUG) {
logger.debug("String_Node_Str");
}
}
if (SystemTray.FORCE_TRAY_TYPE == SystemTray.TYPE_GTK_STATUSICON) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e1) {
if (DEBUG) {
logger.error("String_Node_Str",e1);
}
}
}
 else if (SystemTray.FORCE_TRAY_TYPE == SystemTray.TYPE_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 (trayType == null) {
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)) {
boolean isNewXFCE=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);
isNewXFCE=output.contains("String_Node_Str") || output.contains("String_Node_Str") || output.contains("String_Node_Str")|| output.contains("String_Node_Str");
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
if (DEBUG) {
logger.error("String_Node_Str",isNewXFCE);
}
if (isNewXFCE) {
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 {
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 {
IO.closeQuietly(bin);
}
}
}
}
 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 (OS.isWindows()) {
WindowsSystemTraySwing.fix();
}
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;
CacheUtil.setUniqueCachePerRun=isKDE;
CacheUtil.tempDir="String_Node_Str";
try {
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 (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;
  boolean isKDE=false;
  if (DEBUG) {
    logger.debug("String_Node_Str",isJavaFxLoaded);
    logger.debug("String_Node_Str",isSwtLoaded);
  }
  if (FORCE_TRAY_TYPE != TYPE_SWING && OS.isLinux()) {
    if (isSwtLoaded) {
      String swt_gtk3=System.getProperty("String_Node_Str");
      boolean isSwt_GTK3=swt_gtk3 != null && !swt_gtk3.equals("String_Node_Str");
      if (!isSwt_GTK3) {
        String property=System.getProperty("String_Node_Str");
        isSwt_GTK3=property != null && !property.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_TRAY_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 (FORCE_TRAY_TYPE != TYPE_SWING && OS.isLinux()) {
if (Gtk.isGtk2 || AppIndicator.isVersion3) {
if (DEBUG) {
logger.debug("String_Node_Str");
}
}
if (SystemTray.FORCE_TRAY_TYPE == SystemTray.TYPE_GTK_STATUSICON) {
try {
trayType=GtkSystemTray.class;
}
 catch (Throwable e1) {
if (DEBUG) {
logger.error("String_Node_Str",e1);
}
}
}
 else if (SystemTray.FORCE_TRAY_TYPE == SystemTray.TYPE_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 (trayType == null) {
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)) {
boolean isNewXFCE=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);
isNewXFCE=output.contains("String_Node_Str") || output.contains("String_Node_Str") || output.contains("String_Node_Str")|| output.contains("String_Node_Str");
}
 catch (Throwable e) {
if (DEBUG) {
logger.error("String_Node_Str",e);
}
}
if (DEBUG) {
logger.error("String_Node_Str",isNewXFCE);
}
if (isNewXFCE) {
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 {
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.debug("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 {
IO.closeQuietly(bin);
}
}
}
}
 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 (OS.isWindows()) {
WindowsSystemTraySwing.fix();
}
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;
CacheUtil.setUniqueCachePerRun=isKDE;
CacheUtil.tempDir="String_Node_Str";
try {
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 (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();
}
}
}
);
}
}
}
}