jdk/src/share/classes/javax/swing/LookAndFeel.java
changeset 8380 9b9f901a909d
parent 5506 202f599c92aa
child 9035 1255eb81cc2f
--- a/jdk/src/share/classes/javax/swing/LookAndFeel.java	Fri Feb 18 13:27:29 2011 +0300
+++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java	Fri Feb 18 19:21:57 2011 +0300
@@ -332,12 +332,13 @@
     {
         JTextComponent.KeyBinding[] rv = new JTextComponent.KeyBinding[keyBindingList.length / 2];
 
-        for(int i = 0; i < keyBindingList.length; i += 2) {
-            KeyStroke keystroke = (keyBindingList[i] instanceof KeyStroke)
-                ? (KeyStroke)keyBindingList[i]
-                : KeyStroke.getKeyStroke((String)keyBindingList[i]);
-            String action = (String)keyBindingList[i+1];
-            rv[i / 2] = new JTextComponent.KeyBinding(keystroke, action);
+        for(int i = 0; i < rv.length; i ++) {
+            Object o = keyBindingList[2 * i];
+            KeyStroke keystroke = (o instanceof KeyStroke)
+                ? (KeyStroke) o
+                : KeyStroke.getKeyStroke((String) o);
+            String action = (String) keyBindingList[2 * i + 1];
+            rv[i] = new JTextComponent.KeyBinding(keystroke, action);
         }
 
         return rv;