changeset 9391:b9f416d23fd1

8023148: [macosx] java.util.NoSuchElementException at java.util.LinkedList.getFirst Reviewed-by: ant, serb
author pchelko
date Tue, 17 Dec 2013 11:19:27 +0400
parents 0882c91eb179
children 95cf1f5d7c7f
files src/share/classes/java/awt/DefaultKeyboardFocusManager.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/DefaultKeyboardFocusManager.java	Mon Dec 16 17:35:08 2013 +0400
+++ b/src/share/classes/java/awt/DefaultKeyboardFocusManager.java	Tue Dec 17 11:19:27 2013 +0400
@@ -287,7 +287,7 @@
         synchronized (this) {
             KeyEvent ke = enqueuedKeyEvents.isEmpty() ? null : enqueuedKeyEvents.getFirst();
             if (ke != null && time >= ke.getWhen()) {
-                TypeAheadMarker marker = typeAheadMarkers.getFirst();
+                TypeAheadMarker marker = typeAheadMarkers.isEmpty() ? null : typeAheadMarkers.getFirst();
                 if (marker != null) {
                     Window toplevel = marker.untilFocused.getContainingWindow();
                     // Check that the component awaiting focus belongs to