Program: 96234
Project: 96234
Buggy source:
public static void determineIconSize(){
  double trayScalingFactor=0;
  double menuScalingFactor=0;
  if (SystemTray.AUTO_TRAY_SIZE) {
    if (OS.isWindows()) {
      int[] version=OSUtil.Windows.getVersion();
      if (version[0] <= 5) {
        trayScalingFactor=2;
      }
 else       if (version[0] == 6 && version[1] == 0) {
        trayScalingFactor=2;
      }
 else       if (version[0] == 6 && version[1] <= 2) {
        trayScalingFactor=4;
      }
 else {
        trayScalingFactor=4;
      }
      Pointer screen=User32.GetDC(null);
      int dpiX=GetDeviceCaps(screen,LOGPIXELSX);
      User32.ReleaseDC(null,screen);
      if (dpiX != 96) {
        menuScalingFactor=((double)dpiX) / 96.0;
      }
      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=(int)(SystemTray.DEFAULT_TRAY_SIZE * trayScalingFactor);
  }
 else {
    TRAY_SIZE=SystemTray.DEFAULT_TRAY_SIZE;
  }
  if (menuScalingFactor > 1) {
    ENTRY_SIZE=(int)(SystemTray.DEFAULT_MENU_SIZE * menuScalingFactor);
  }
 else {
    ENTRY_SIZE=SystemTray.DEFAULT_MENU_SIZE;
  }
  if (OS.isWindows()) {
    Font font=new JMenuItem().getFont().deriveFont(Font.PLAIN);
    if (menuScalingFactor > 1) {
      font=ImageUtils.getFontForSpecificHeight(font,ENTRY_SIZE);
      if (SystemTray.DEBUG) {
        SystemTray.logger.debug("String_Node_Str",font.getSize(),ENTRY_SIZE);
      }
    }
 else     if (SystemTray.DEBUG) {
      SystemTray.logger.debug("String_Node_Str",font.getSize(),ENTRY_SIZE);
    }
    ENTRY_FONT=font;
  }
  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(){
  double trayScalingFactor=0;
  double menuScalingFactor=0;
  if (SystemTray.AUTO_TRAY_SIZE) {
    if (OS.isWindows()) {
      int[] version=OSUtil.Windows.getVersion();
      if (version[0] <= 5) {
        trayScalingFactor=2;
      }
 else       if (version[0] == 6 && version[1] == 0) {
        trayScalingFactor=2;
      }
 else       if (version[0] == 6 && version[1] <= 2) {
        trayScalingFactor=4;
      }
 else {
        trayScalingFactor=4;
      }
      Pointer screen=User32.GetDC(null);
      int dpiX=GetDeviceCaps(screen,LOGPIXELSX);
      User32.ReleaseDC(null,screen);
      if (dpiX != 96) {
        menuScalingFactor=((double)dpiX) / 96.0;
      }
      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=(int)(SystemTray.DEFAULT_TRAY_SIZE * trayScalingFactor);
  }
 else {
    TRAY_SIZE=SystemTray.DEFAULT_TRAY_SIZE;
  }
  if (menuScalingFactor > 1) {
    ENTRY_SIZE=(int)(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);
  }
}