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

JLayer.isOptimizedDrawingEnabled() throws NPE for null glass pane set

XMLWordPrintable

    • b72
    • generic
    • generic

      Method javax.swingJLayer.isOptimizedDrawingEnabled() throws NPE if glass pane is set to null.

      Please see the following code sample:

      public class NPE {
          public static void main(String[] args) {
              javax.swing.JLayer layer = new javax.swing.JLayer();
              layer.setGlassPane(null);
              layer.isOptimizedDrawingEnabled();
          }
      }

      Exception in thread "main" java.lang.NullPointerException
      at javax.swing.JLayer.isOptimizedDrawingEnabled(JLayer.java:322)
      ...
      The following JCK test fails due to this problem
      api/javax_swing/JLayer/index.html#General[isOptimizedDrawingEnabled_nullGlassPane]

            alexp Alexander Potochkin (Inactive)
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: