Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8336879

Always true condition 'img != null' in GTKPainter.paintPopupMenuBackground

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 24
    • 9, 17, 21, 22, 23
    • client-libs
    • 9
    • b09

      There is a suspicious condition in the 'com.sun.java.swing.plaf.gtk.GTKPainter#paintPopupMenuBackground' method:

                  BufferedImage img = ENGINE.finishPainting();
                  if(!isHW) {
                      int border = img.getRGB(0, h / 2);
                      if (img != null && border == img.getRGB(w / 2, h / 2)) {

      'img != null' condition is always true, because it's only checked after 'img.getRGB` method is called - it means img can't be 'null'.

            abhiscxk Abhishek Kumar
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: