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

Regression : NullPointerException when scrolling horizontally on AWT List

XMLWordPrintable

    • b142
    • generic
    • generic
    • Verified

      SYNOPSIS
      --------
      NullPointerException when scrolling horizontally on AWT List

      OPERATING SYSTEM
      ----------------
      Probably All platforms.
      Test on Solaris x86 and Linux.

      FULL JDK VERSION
      -------------------
      JDK 7 b137.
      Reproducible back to at least b32.
      Not reproducible using JDK 6.

      DESCRIPTION
      -----------
      NullPointerException occurs when we scrolled horizontally in AWT List.

      REPRODUCTION INSTRUCTIONS
      -------------------------
      1. Compile and launch the attached testcase
      2. Drag the scroll bar of AWT List horizontally. You will observe the
         following NullPointerException:

      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
              at sun.awt.X11.XListPeer$ListPainter.paint(XListPeer.java:1796)
              at sun.awt.X11.XListPeer$ListPainter.access$000(XListPeer.java:1672)
              at sun.awt.X11.XListPeer.repaint(XListPeer.java:415)
              at sun.awt.X11.XListPeer.scrollHorizontal(XListPeer.java:1492)
              at sun.awt.X11.XListPeer.notifyValue(XListPeer.java:1016)
              at sun.awt.X11.XScrollbar$1.run(XScrollbar.java:112)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
              at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
              at java.awt.EventQueue.access$000(EventQueue.java:101)
              at java.awt.EventQueue$3.run(EventQueue.java:666)
              at java.awt.EventQueue$3.run(EventQueue.java:664)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
              at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
              at java.awt.EventQueue$4.run(EventQueue.java:680)
              at java.awt.EventQueue$4.run(EventQueue.java:678)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

      TESTCASE
      --------
      import java.awt.*;

      public class ListTest extends Frame {

          ListTest(String[] testStrings){
              List l = new List(testStrings.length, false);
              for (int i=0 ; i < testStrings.length ; i++) {
                  l.add(testStrings[i]);
              }
              add(l);
              pack();
              setSize(200, 100);
          }

          public static void main(String[] args){
              String[] strings = {
                  "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
                  "12345678901234567890123456789012345678901234567890"
              };
              ListTest test = new ListTest(strings);
              test.setVisible(true);
          }
      }

            dav Andrei Dmitriev (Inactive)
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: