Index: trunk/src/org/openstreetmap/josm/gui/tagging/AutoCompletingTextField.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/AutoCompletingTextField.java	(revision 2087)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/AutoCompletingTextField.java	(revision 2088)
@@ -7,8 +7,5 @@
 import java.awt.event.KeyAdapter;
 import java.awt.event.KeyEvent;
-import java.util.ArrayList;
 import java.util.EventObject;
-import java.util.LinkedList;
-import java.util.List;
 import java.util.logging.Logger;
 
@@ -17,5 +14,4 @@
 import javax.swing.JTextField;
 import javax.swing.event.CellEditorListener;
-import javax.swing.event.ChangeEvent;
 import javax.swing.table.TableCellEditor;
 import javax.swing.text.AttributeSet;
@@ -194,5 +190,4 @@
             setText(anObject.toString());
         }
-
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 2087)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 2088)
@@ -68,18 +68,12 @@
     public String locale_name;
 
-    private static AutoCompletionList autoCompletionList;
-
-    public static AutoCompletionList getPresetAutocompletionList() {
-        if (autoCompletionList == null) {
-            autoCompletionList = new AutoCompletionList();
-        }
-        return autoCompletionList;
-    }
-
     public static abstract class Item {
         protected void initAutoCompletionField(AutoCompletingTextField field, String key) {
             OsmDataLayer layer = Main.main.getEditLayer();
             if (layer == null) return;
-            field.setAutoCompletionList(getPresetAutocompletionList());
+            AutoCompletionList list  = new AutoCompletionList();
+            List<String> values = AutoCompletionCache.getCacheForLayer(Main.main.getEditLayer()).getValues(key);
+            list.add(values,AutoCompletionItemPritority.IS_IN_DATASET);
+            field.setAutoCompletionList(list);
         }
 
@@ -154,7 +148,7 @@
             // find out if our key is already used in the selection.
             Usage usage = determineTextUsage(sel, key);
+            AutoCompletingTextField textField = new AutoCompletingTextField();
+            initAutoCompletionField(textField, key);
             if (usage.unused()){
-                AutoCompletingTextField textField = new AutoCompletingTextField();
-                initAutoCompletionField(textField, key);
                 if (use_last_as_default && lastValue.containsKey(key)) {
                     textField.setText(lastValue.get(key));
@@ -166,6 +160,4 @@
             } else if (usage.hasUniqueValue()) {
                 // all objects use the same value
-                AutoCompletingTextField textField = new AutoCompletingTextField();
-                initAutoCompletionField(textField, key);
                 textField.setText(usage.getFirst());
                 value = textField;
@@ -173,6 +165,4 @@
             } else {
                 // the objects have different values
-                AutoCompletingTextField textField = new AutoCompletingTextField();
-                initAutoCompletionField(textField, key);
                 JComboBox comboBox = new JComboBox(usage.values.toArray());
                 comboBox.setEditable(true);
@@ -646,16 +636,4 @@
     }
 
-    protected void refreshAutocompletionList(final OsmDataLayer layer) {
-        Runnable task = new Runnable() {
-            public void run() {
-                System.out.print("refreshing preset auto completion list ...");
-                AutoCompletionCache.getCacheForLayer(layer).initFromDataSet();
-                AutoCompletionCache.getCacheForLayer(layer).populateWithValues( getPresetAutocompletionList(), false /* don't append */);
-                System.out.println("DONE");
-            }
-        };
-        new Thread(task).run();
-
-    }
     public PresetPanel createPanel(Collection<OsmPrimitive> selected) {
         if (data == null)
@@ -663,5 +641,5 @@
         OsmDataLayer layer = Main.main.getEditLayer();
         if (layer != null) {
-            refreshAutocompletionList(layer);
+            AutoCompletionCache.getCacheForLayer(layer).initFromDataSet();
         }
         PresetPanel p = new PresetPanel();
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionCache.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionCache.java	(revision 2087)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionCache.java	(revision 2088)
@@ -3,8 +3,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
@@ -74,6 +72,4 @@
     /** the cached list of member roles */
     private  Set<String> roleCache;
-    /** the cache of all tag values */
-    private  Set<String> allTagValues;
     /**  the layer this cache is built for */
     private OsmDataLayer layer;
@@ -86,5 +82,4 @@
         tagCache = new HashMap<String, Set<String>>();
         roleCache = new HashSet<String>();
-        allTagValues = new HashSet<String>();
         this.layer = layer;
     }
@@ -114,5 +109,4 @@
         cacheKey(key);
         tagCache.get(key).add(value);
-        allTagValues.add(value);
     }
 
@@ -236,19 +230,3 @@
         list.add(tagCache.keySet(), AutoCompletionItemPritority.IS_IN_DATASET);
     }
-
-
-    /**
-     * Populates the an {@see AutoCompletionList} with the currently cached
-     * tag values
-     *
-     * @param list the list to populate
-     * @param append true to add the keys to the list; false, to replace the keys
-     * in the list by the keys in the cache
-     */
-    public void populateWithValues(AutoCompletionList list, boolean append) {
-        if (!append) {
-            list.clear();
-        }
-        list.add(this.allTagValues, AutoCompletionItemPritority.IS_IN_DATASET);
-    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java	(revision 2087)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java	(revision 2088)
@@ -4,5 +4,7 @@
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.swing.JTable;
@@ -33,4 +35,6 @@
     /** the filter expression */
     private String filter = null;
+    /** map from value to priority */
+    private Map<String,AutoCompletionListItem> valutToItemMap;
 
     /**
@@ -40,4 +44,5 @@
         list = new ArrayList<AutoCompletionListItem>();
         filtered = new ArrayList<AutoCompletionListItem>();
+        valutToItemMap = new HashMap<String, AutoCompletionListItem>();
     }
 
@@ -148,9 +153,10 @@
 
     protected void appendOrUpdatePriority(AutoCompletionListItem toadd) {
-        AutoCompletionListItem item = lookup(toadd.getValue());
+        AutoCompletionListItem item = valutToItemMap.get(toadd.getValue());
         if (item == null) {
             // new item does not exist yet. Add it to the list
             //
             list.add(toadd);
+            valutToItemMap.put(toadd.getValue(), toadd);
         } else {
             // new item already exists. Update priority if necessary
@@ -191,21 +197,4 @@
         return false;
     }
-
-    /**
-     * 
-     * @param value a specific value
-     * @return  the auto completion item for this value; null, if there is no
-     *   such auto completion item
-     */
-    public AutoCompletionListItem lookup(String value) {
-        if (value == null)
-            return null;
-        for (AutoCompletionListItem item : list) {
-            if (item.getValue().equals(value))
-                return item;
-        }
-        return null;
-    }
-
 
     /**
