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

Java2Demo throws NPE when dereferencing null returned from createImage()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 5.0-pool
    • 5.0
    • client-libs
    • None
    • generic
    • generic

      Name: agR10216 Date: 02/28/2004


      Running demo/jfc/Java2D/Java2Demo.jar with the tiger build 36,
      I occasionally got the following exception:
          java.lang.NullPointerException
                  at java2d.PerformanceMonitor$Surface.run(PerformanceMonitor.java:153)
                  at java.lang.Thread.run(Thread.java:566)

      Here are the pertinent lines from java2d.PerformanceMonitor$Surface.run():
                  bimg = (BufferedImage) createImage(d.width, d.height);
                  Graphics2D big = bimg.createGraphics();

      The second line may throw NPE since createImage() may return null as it's
      specified in the javadoc for Component.createImage(int width, int height).

      The demo should be revised to work correctly in this case.

      ###@###.### 2004-02-28
      ======================================================================

            Unassigned Unassigned
            agerasimsunw Alexander Gerasimov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: