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

On Win32 Graphics methods after dispose cause NullPointerException (Solaris okay

XMLWordPrintable

    • 2d
    • beta
    • generic
    • windows_nt


      We've got a slight inconsistency in our code when a Graphics object is
      used after a dispose. The Javadoc comment indicate that the Graphics
      object should not be used after a dipose BUT the Class Libraries book
      suggests that operations are ignored after a dispose.

      The Solaris/X11 code does ignore operations after the dispose and the
      Win32 follows this behaviour for some methods. However for the drawPolygon
      and drawPolyline methods the Win32 code generates a NullPointerException.

      So for example :-

        g.dispose();
        Polygon p = new Polygon();
        p.addPoint( 10, 10 );
        g.drawPolygon( p );

      The drawPolyon is ignored on Solaris but generates an exception on Win32.

            flar Jim Graham
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: