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

NPE in LWWindowPeer.getOnscreenGraphics()

XMLWordPrintable

    • b07

        The LWWindowPeer.getOnscreenGraphics() is incorrectly null-check the surface data:
           protected final Graphics getOnscreenGraphics(Color fg, Color bg, Font f) {
            [1] if (getSurfaceData() == null) {
                    return null;
                }
        .....
                if (f == null) {
                    f = DEFAULT_FONT;
                }
            [2] return new SunGraphics2D(getSurfaceData(), fg, bg, f);
            }
        If surfaceData became null after the check [1] but before [2] we wil get NPE.

              serb Sergey Bylokhov
              serb Sergey Bylokhov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: