You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2011/04/07 14:14:37 UTC

svn commit: r1089843 - /uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/QuickTypeSelectionDialog.java

Author: joern
Date: Thu Apr  7 12:14:37 2011
New Revision: 1089843

URL: http://svn.apache.org/viewvc?rev=1089843&view=rev
Log:
UIMA-2112 Fixed loop bug and fixed a bug in the label provider in case there is no shortcut assigned to a type.

Modified:
    uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/QuickTypeSelectionDialog.java

Modified: uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/QuickTypeSelectionDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/QuickTypeSelectionDialog.java?rev=1089843&r1=1089842&r2=1089843&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/QuickTypeSelectionDialog.java (original)
+++ uima/uimaj/trunk/uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/editor/QuickTypeSelectionDialog.java Thu Apr  7 12:14:37 2011
@@ -141,17 +141,14 @@ class QuickTypeSelectionDialog extends P
     }
 
     // Now assign letters to the remaining types
-    for (Iterator<Type> it = types.iterator(); it.hasNext();) {
+    for (Iterator<Type> it = types.iterator(); it.hasNext() && shortcuts.size() > 0;) {
 
-      if (shortcuts.size() > 0) {
+      Character candidateChar = shortcuts.iterator().next();
 
-        Character candidateChar = shortcuts.iterator().next();
+      putShortcut(candidateChar, it.next());
 
-        putShortcut(candidateChar, it.next());
-
-        shortcuts.remove(candidateChar);
-        it.remove();
-      }
+      shortcuts.remove(candidateChar);
+      it.remove();
     }
   }
 
@@ -279,7 +276,7 @@ class QuickTypeSelectionDialog extends P
 
         Character key = typeShortcutMap.get(type);
 
-        if (typeShortcutMap != null) {
+        if (key != null) {
           return "[" + key + "] " + type.getShortName();
         } else {
           return type.getShortName();