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

PIT: BufferedImage.flush() throws NPE in some cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • client-libs
    • 2d
    • tiger
    • generic, x86
    • generic, windows_2000, windows_xp

      Calling BufferedImage.flush() before that image is ever rendered to or copied
      from will cause a NullPointerException to be thrown. The following testcase
      reproduces the problem easily on the latest 2D nightly builds:

      import java.awt.image.BufferedImage;

      public class FlushTest {

          public static void main(String[] args) {
              try {
                  BufferedImage bi = new BufferedImage(10, 10,
                                                       BufferedImage.TYPE_INT_RGB);
                  bi.flush();
              } catch (NullPointerException npe) {
                  throw new RuntimeException("Test failed: NPE thrown in " +
                                             "BufferedImage.flush()");
              }
          }
      }

            campbell Christopher Campbell (Inactive)
            campbell Christopher Campbell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: