Program: 96239
Project: 96239
Buggy source:
public static void determineIconSize(){
  int trayScalingFactor=0;
  int menuScalingFactor=0;
  if (SystemTray.AUTO_TRAY_SIZE) {
    if (OS.isWindows()) {
      int[] version=OSUtil.Windows.getVersion();
      if (version[0] <= 5) {
        trayScalingFactor=1;
      }
 else       if (version[0] == 6 && version[1] == 0) {
        trayScalingFactor=1;
      }
 else       if (version[0] == 6 && version[1] <= 2) {
        trayScalingFactor=2;
      }
 else       if (version[0] == 6 || (version[0] == 10 && version[1] == 0)) {
        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",Arrays.toString(version));
        SystemTray.logger.debug("String_Node_Str",dpiX);
      }
    }
 else     if (OS.isLinux()) {
      String XDG=System.getenv("String_Node_Str");
      if (XDG == null) {
        double plasmaVersion=OSUtil.Linux.DesktopEnv.getPlasmaVersion();
        if (plasmaVersion > 0) {
          XDG="String_Node_Str";
        }
      }
      if ("String_Node_Str".equalsIgnoreCase(XDG)) {
        double plasmaVersion=OSUtil.Linux.DesktopEnv.getPlasmaVersion();
        if (plasmaVersion > 0) {
          trayScalingFactor=2;
        }
 else         if (SystemTray.DEBUG) {
          SystemTray.logger.error("String_Node_Str");
        }
      }
 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());
              trayScalingFactor=Integer.parseInt(value);
              menuScalingFactor=Integer.parseInt(value);
            }
          }
        }
 catch (        Throwable e) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",e);
          }
        }
        int fedoraVersion=OSUtil.Linux.getFedoraVersion();
        if (trayScalingFactor == 0 && fedoraVersion >= 23) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.debug("String_Node_Str" + fedoraVersion);
          }
          trayScalingFactor=2;
        }
      }
    }
 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;
  }
 else {
    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()) {
      int[] version=OSUtil.Windows.getVersion();
      if (version[0] <= 5) {
        trayScalingFactor=1;
      }
 else       if (version[0] == 6 && version[1] == 0) {
        trayScalingFactor=1;
      }
 else       if (version[0] == 6 && version[1] <= 2) {
        trayScalingFactor=2;
      }
 else       if (version[0] == 6 || (version[0] == 10 && version[1] == 0)) {
        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",Arrays.toString(version));
        SystemTray.logger.debug("String_Node_Str",dpiX);
      }
    }
 else     if (OS.isLinux() || OS.isUnix()) {
      String XDG=System.getenv("String_Node_Str");
      if (XDG == null) {
        double plasmaVersion=OSUtil.DesktopEnv.getPlasmaVersion();
        if (plasmaVersion > 0) {
          XDG="String_Node_Str";
        }
      }
      if ("String_Node_Str".equalsIgnoreCase(XDG)) {
        double plasmaVersion=OSUtil.DesktopEnv.getPlasmaVersion();
        if (plasmaVersion > 0) {
          trayScalingFactor=2;
        }
 else         if (SystemTray.DEBUG) {
          SystemTray.logger.error("String_Node_Str");
        }
      }
 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());
              trayScalingFactor=Integer.parseInt(value);
              menuScalingFactor=Integer.parseInt(value);
            }
          }
        }
 catch (        Throwable e) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.error("String_Node_Str",e);
          }
        }
        int fedoraVersion=OSUtil.Linux.getFedoraVersion();
        if (trayScalingFactor == 0 && fedoraVersion >= 23) {
          if (SystemTray.DEBUG) {
            SystemTray.logger.debug("String_Node_Str" + fedoraVersion);
          }
          trayScalingFactor=2;
        }
      }
    }
 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;
  }
 else {
    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);
  }
}