-
Bug
-
Resolution: Duplicate
-
P3
-
8
-
x86_64
-
windows_7
FULL PRODUCT VERSION :
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Here's an upstream bug for two bug reports we have received for our application (JOSM):
- https://josm.openstreetmap.de/ticket/9991
- https://josm.openstreetmap.de/ticket/10038
Both users report a NoSuchElementException in java.awt.DefaultKeyboardFocusManager.repostIfFollowsKeyEvents from the EDT.
This issue has only be seen with Java 8u5 and Windows 7 64-bit for now.
I have looked to JDK8u5 source code, it appears the exception is thrown from one of these two lines:
KeyEvent ke = enqueuedKeyEvents.isEmpty() ? null : enqueuedKeyEvents.getFirst();
TypeAheadMarker marker = typeAheadMarkers.getFirst();
I don't think the problem comes from the first line, as enqueuedKeyEvents variable appears to be only accessed from synchronized blocks.
However the second line does not check if typeAheadMarkers is not empty before calling getFirst(), so it may come from this.
As we've never seen this error with Java 7 before, and the method repostIfFollowsKeyEvents() is new in Java 8, it looks like a JDK8 regression.
REGRESSION. Last worked in version 7u55
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.util.NoSuchElementException
at java.util.LinkedList.getFirst(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.repostIfFollowsKeyEvents(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.SequencedEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
REPRODUCIBILITY :
This bug can be reproduced occasionally.
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Here's an upstream bug for two bug reports we have received for our application (JOSM):
- https://josm.openstreetmap.de/ticket/9991
- https://josm.openstreetmap.de/ticket/10038
Both users report a NoSuchElementException in java.awt.DefaultKeyboardFocusManager.repostIfFollowsKeyEvents from the EDT.
This issue has only be seen with Java 8u5 and Windows 7 64-bit for now.
I have looked to JDK8u5 source code, it appears the exception is thrown from one of these two lines:
KeyEvent ke = enqueuedKeyEvents.isEmpty() ? null : enqueuedKeyEvents.getFirst();
TypeAheadMarker marker = typeAheadMarkers.getFirst();
I don't think the problem comes from the first line, as enqueuedKeyEvents variable appears to be only accessed from synchronized blocks.
However the second line does not check if typeAheadMarkers is not empty before calling getFirst(), so it may come from this.
As we've never seen this error with Java 7 before, and the method repostIfFollowsKeyEvents() is new in Java 8, it looks like a JDK8 regression.
REGRESSION. Last worked in version 7u55
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.util.NoSuchElementException
at java.util.LinkedList.getFirst(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.repostIfFollowsKeyEvents(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.SequencedEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
REPRODUCIBILITY :
This bug can be reproduced occasionally.
- duplicates
-
JDK-8023148 [macosx] java.util.NoSuchElementException at java.util.LinkedList.getFirst
-
- Resolved
-