Program: 96297
Project: 96297
Buggy source:
public static void determineIconSize(){
  int trayScalingFactor=0;
  int menuScalingFactor=0;
  if (SystemTray.AUTO_TRAY_SIZE) {
    if (OS.isWindows()) {
      String windowsVersion="String_Node_Str";
      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.addArgument("String_Node_Str");
        shellVersion.start();
        String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
        if (!output.isEmpty()) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.debug("String_Node_Str",output);
          }
          if (output.contains("String_Node_Str")) {
            int beginIndex=output.indexOf("String_Node_Str") + 7;
            windowsVersion=output.substring(beginIndex,beginIndex + 6);
          }
        }
      }
 catch (      Throwable e) {
        if (SystemTray.DEBUG) {
          SystemTray.logger.error("String_Node_Str",e);
        }
      }
      if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=1;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=1;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=1;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=2;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=2;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=4;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=4;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=4;
      }
 else {
        trayScalingFactor=8;
      }
      Pointer screen=User32.GetDC(null);
      int dpiX=GetDeviceCaps(screen,LOGPIXELSX);
      User32.ReleaseDC(null,screen);
      if (dpiX != 96) {
        trayScalingFactor=(int)(((double)dpiX) / ((double)96)) * 2;
        menuScalingFactor=trayScalingFactor;
      }
      if (SystemTray.DEBUG) {
        SystemTray.logger.debug("String_Node_Str",windowsVersion);
        SystemTray.logger.debug("String_Node_Str",dpiX);
      }
    }
 else     if (OS.isLinux()) {
      if ("String_Node_Str".equalsIgnoreCase(System.getenv("String_Node_Str"))) {
        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 (SystemTray.DEBUG) {
              SystemTray.logger.debug("String_Node_Str",output);
            }
            String s="String_Node_Str";
            if (output.contains(s)) {
              String value=output.substring(output.indexOf(s) + s.length(),output.length() - 1);
              if (value.startsWith("String_Node_Str")) {
                trayScalingFactor=2;
              }
 else               if (value.startsWith("String_Node_Str")) {
                trayScalingFactor=8;
              }
 else {
                trayScalingFactor=2;
              }
            }
          }
        }
 catch (        Throwable e) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",e);
          }
        }
      }
 else {
        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.addArgument("String_Node_Str");
          shellVersion.addArgument("String_Node_Str");
          shellVersion.start();
          String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
          if (!output.isEmpty()) {
            if (SystemTray.DEBUG) {
              SystemTray.logger.debug("String_Node_Str",output);
            }
            if (output.contains("String_Node_Str")) {
              String value=output.substring(output.indexOf("String_Node_Str") + 7,output.length() - 1);
              trayScalingFactor=Integer.parseInt(value);
            }
          }
        }
 catch (        Throwable e) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",e);
          }
        }
      }
    }
 else     if (OS.isMacOsX()) {
      int height=(int)java.awt.SystemTray.getSystemTray().getTrayIconSize().getHeight();
      if (height < 32) {
        trayScalingFactor=2;
      }
 else       if ((height & (height - 1)) == 0) {
        trayScalingFactor=height / SystemTray.DEFAULT_TRAY_SIZE;
      }
 else {
        trayScalingFactor=8;
      }
    }
  }
  if (trayScalingFactor > 1) {
    TRAY_SIZE=SystemTray.DEFAULT_TRAY_SIZE * trayScalingFactor;
  }
 else {
    TRAY_SIZE=SystemTray.DEFAULT_TRAY_SIZE;
  }
  if (menuScalingFactor > 1) {
    ENTRY_SIZE=SystemTray.DEFAULT_MENU_SIZE * menuScalingFactor;
  }
  ENTRY_SIZE=SystemTray.DEFAULT_MENU_SIZE;
  if (SystemTray.DEBUG) {
    SystemTray.logger.debug("String_Node_Str",trayScalingFactor,TRAY_SIZE);
    SystemTray.logger.debug("String_Node_Str",menuScalingFactor,ENTRY_SIZE);
  }
}

Fixed version (ground truth):
public static void determineIconSize(){
  int trayScalingFactor=0;
  int menuScalingFactor=0;
  if (SystemTray.AUTO_TRAY_SIZE) {
    if (OS.isWindows()) {
      String windowsVersion="String_Node_Str";
      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.addArgument("String_Node_Str");
        shellVersion.start();
        String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
        if (!output.isEmpty()) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.debug("String_Node_Str",output);
          }
          if (output.contains("String_Node_Str")) {
            int beginIndex=output.indexOf("String_Node_Str") + 7;
            windowsVersion=output.substring(beginIndex,beginIndex + 6);
          }
        }
      }
 catch (      Throwable e) {
        if (SystemTray.DEBUG) {
          SystemTray.logger.error("String_Node_Str",e);
        }
      }
      if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=1;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=1;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=1;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=2;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=2;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=4;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=4;
      }
 else       if (windowsVersion.startsWith("String_Node_Str")) {
        trayScalingFactor=4;
      }
 else {
        trayScalingFactor=8;
      }
      Pointer screen=User32.GetDC(null);
      int dpiX=GetDeviceCaps(screen,LOGPIXELSX);
      User32.ReleaseDC(null,screen);
      if (dpiX != 96) {
        trayScalingFactor=(int)(((double)dpiX) / ((double)96)) * 2;
        menuScalingFactor=trayScalingFactor;
      }
      if (SystemTray.DEBUG) {
        SystemTray.logger.debug("String_Node_Str",windowsVersion);
        SystemTray.logger.debug("String_Node_Str",dpiX);
      }
    }
 else     if (OS.isLinux()) {
      if ("String_Node_Str".equalsIgnoreCase(System.getenv("String_Node_Str"))) {
        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 (SystemTray.DEBUG) {
              SystemTray.logger.debug("String_Node_Str",output);
            }
            String s="String_Node_Str";
            if (output.contains(s)) {
              String value=output.substring(output.indexOf(s) + s.length(),output.length() - 1);
              if (value.startsWith("String_Node_Str")) {
                trayScalingFactor=2;
              }
 else               if (value.startsWith("String_Node_Str")) {
                trayScalingFactor=8;
              }
 else {
                trayScalingFactor=2;
              }
            }
          }
        }
 catch (        Throwable e) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",e);
          }
        }
      }
 else {
        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.addArgument("String_Node_Str");
          shellVersion.addArgument("String_Node_Str");
          shellVersion.start();
          String output=ShellProcessBuilder.getOutput(byteArrayOutputStream);
          if (!output.isEmpty()) {
            if (SystemTray.DEBUG) {
              SystemTray.logger.debug("String_Node_Str",output);
            }
            if (output.contains("String_Node_Str")) {
              String value=output.substring(output.indexOf("String_Node_Str") + 7,output.length() - 1);
              trayScalingFactor=Integer.parseInt(value);
            }
          }
        }
 catch (        Throwable e) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",e);
          }
        }
      }
    }
 else     if (OS.isMacOsX()) {
      int height;
      if (!SwingUtilities.isEventDispatchThread()) {
        final AtomicInteger h=new AtomicInteger(0);
        SwingUtil.invokeAndWaitQuietly(new Runnable(){
          @Override public void run(){
            h.set((int)java.awt.SystemTray.getSystemTray().getTrayIconSize().getHeight());
          }
        }
);
        height=h.get();
      }
 else {
        height=(int)java.awt.SystemTray.getSystemTray().getTrayIconSize().getHeight();
      }
      if (height < 32) {
        trayScalingFactor=2;
      }
 else       if ((height & (height - 1)) == 0) {
        trayScalingFactor=height / SystemTray.DEFAULT_TRAY_SIZE;
      }
 else {
        trayScalingFactor=8;
      }
    }
  }
  if (trayScalingFactor > 1) {
    TRAY_SIZE=SystemTray.DEFAULT_TRAY_SIZE * trayScalingFactor;
  }
 else {
    TRAY_SIZE=SystemTray.DEFAULT_TRAY_SIZE;
  }
  if (menuScalingFactor > 1) {
    ENTRY_SIZE=SystemTray.DEFAULT_MENU_SIZE * menuScalingFactor;
  }
  ENTRY_SIZE=SystemTray.DEFAULT_MENU_SIZE;
  if (SystemTray.DEBUG) {
    SystemTray.logger.debug("String_Node_Str",trayScalingFactor,TRAY_SIZE);
    SystemTray.logger.debug("String_Node_Str",menuScalingFactor,ENTRY_SIZE);
  }
}