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

JComponent painting cleanup

XMLWordPrintable

    • b11
    • generic, x86
    • generic, windows_xp

      Name: js151677 Date: 08/02/2004


      FULL PRODUCT VERSION :
      java version "1.5.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
      Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      In javax.swing.JComponent

      in

      void _paintImmediately(int x, int y, int w, int h)

      is this:

      try {
      try {
      Graphics pcg = paintingComponent.getGraphics();
      g = (pcg == null) ? null : pcg.create();
      pcg.dispose();
      } catch(NullPointerException e) {
      g = null;
      e.printStackTrace();
      }

      If pcg is null, pcg.dispose will still be disposed.
      Thus the reason for unneccessary try/catch block


      REPRODUCIBILITY :
      This bug can be reproduced always.
      (Incident Review ID: 290502)
      ======================================================================
      ###@###.### 10/14/04 22:25 GMT

            svioletsunw Scott Violet (Inactive)
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: