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

ArrayIndexOutOfBoundsException in Win32GraphicsEnvironment if display is removed

XMLWordPrintable

    • b112
    • x86
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.7.0_01"
      Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
      Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      This bug report is related to bug #6358034.

      When removing a secondary display I sometimes get the following exception in Swing applications:

      java.lang.ArrayIndexOutOfBoundsException: 1
      at sun.awt.Win32GraphicsEnvironment.getDefaultScreenDevice(Win32GraphicsEnvironment.java:96)
      at sun.awt.windows.WWindowPeer.updateGC(WWindowPeer.java:468)
      at sun.awt.windows.WWindowPeer.displayChanged(WWindowPeer.java:506)
      at sun.awt.SunDisplayChanger.notifyListeners(SunDisplayChanger.java:132)
      at sun.awt.Win32GraphicsDevice.displayChanged(Win32GraphicsDevice.java:488)
      at sun.java2d.d3d.D3DGraphicsDevice.displayChanged(D3DGraphicsDevice.java:488)
      at sun.awt.Win32GraphicsEnvironment.displayChanged(Win32GraphicsEnvironment.java:184)
      at sun.awt.windows.WToolkit$3.run(WToolkit.java:758)
      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.awt.EventQueue.dispatchEvent(EventQueue.java:675)
      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)

      Looking at the method in question, we're invoking the following code:

         getScreenDevices()[getDefaultScreen()]

      It looks like the list of devices is changing between the time getScreenDevices() and getDefaultScreen() are invoked.


      REPRODUCIBILITY :
      This bug can be reproduced occasionally.

            malenkov Sergey Malenkov (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: