Index: trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 2905)
+++ trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 2906)
@@ -250,12 +250,12 @@
         ways.add(b);
 
-        // This is mostly copied and pasted from CombineWayAction.java and one day should be moved into tools
+        // FIXME: This is mostly copied and pasted from CombineWayAction.java and one day should be moved into tools
         Map<String, Set<String>> props = new TreeMap<String, Set<String>>();
         for (Way w : ways) {
-            for (Entry<String,String> e : w.entrySet()) {
-                if (!props.containsKey(e.getKey())) {
-                    props.put(e.getKey(), new TreeSet<String>());
-                }
-                props.get(e.getKey()).add(e.getValue());
+            for (String key: w.keySet()) {
+                if (!props.containsKey(key)) {
+                    props.put(key, new TreeSet<String>());
+                }
+                props.get(key).add(w.get(key));
             }
         }
Index: trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 2905)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 2906)
@@ -7,5 +7,4 @@
 import java.io.PushbackReader;
 import java.io.StringReader;
-import java.util.Map.Entry;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -194,7 +193,6 @@
                  */
 
-                for (Entry<String, String> e : osm.entrySet()) {
-                    String k = e.getKey();
-                    String v = e.getValue();
+                for (String k: osm.keySet()) {
+                    String v = osm.get(k);
 
                     Matcher matcherKey = keyPattern.matcher(k);
@@ -330,8 +328,8 @@
             case ANY_VALUE_REGEXP:
             case EXACT_REGEXP:
-                for (Entry<String, String> entry:osm.entrySet()) {
-                    if (keyPattern.matcher(entry.getKey()).matches()) {
+                for (String key: osm.keySet()) {
+                    if (keyPattern.matcher(key).matches()) {
                         if (mode == Mode.ANY_VALUE_REGEXP
-                                || valuePattern.matcher(entry.getValue()).matches())
+                                || valuePattern.matcher(osm.get(key)).matches())
                             return true;
                     }
@@ -384,8 +382,7 @@
             // is not Java 1.5
             //search = java.text.Normalizer.normalize(search, java.text.Normalizer.Form.NFC);
-            for (Entry<String, String> e : osm.entrySet()) {
+            for (String key: osm.keySet()) {
+                String value = osm.get(key);
                 if (searchRegex != null) {
-                    String key = e.getKey();
-                    String value = e.getValue();
 
                     // is not Java 1.5
@@ -401,6 +398,8 @@
                         return true;
                 } else {
-                    String key = caseSensitive ? e.getKey() : e.getKey().toLowerCase();
-                    String value = caseSensitive ? e.getValue() : e.getValue().toLowerCase();
+                    if (caseSensitive) {
+                        key = key.toLowerCase();
+                        value = value.toLowerCase();
+                    }
 
                     // is not Java 1.5
Index: trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java	(revision 2905)
+++ trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java	(revision 2906)
@@ -5,5 +5,4 @@
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Map.Entry;
 
 import javax.swing.JOptionPane;
@@ -50,6 +49,7 @@
     private boolean checkMaxNodes(Collection<OsmPrimitive> primitives, long maxNodes) {
         for (OsmPrimitive osmPrimitive : primitives) {
-            for (Entry<String,String> e : osmPrimitive.entrySet()) {
-                if(e.getValue().length() > 255) {
+            for (String key: osmPrimitive.keySet()) {
+                String value = osmPrimitive.get(key);
+                if(key.length() > 255) {
                     if (osmPrimitive.isDeleted()) {
                         // if OsmPrimitive is going to be deleted we automatically shorten the
@@ -57,14 +57,14 @@
                         System.out.println(
                                 tr("Warning: automatically truncating value of tag ''{0}'' on deleted object {1}",
-                                        e.getKey(),
+                                        key,
                                         Long.toString(osmPrimitive.getId())
                                 )
                         );
-                        osmPrimitive.put(e.getKey(), e.getValue().substring(0, 255));
+                        osmPrimitive.put(key, value.substring(0, 255));
                         continue;
                     }
                     JOptionPane.showMessageDialog(Main.parent,
                             tr("Length of value for tag ''{0}'' on object {1} exceeds the max. allowed length {2}. Values length is {3}.",
-                                    e.getKey(), Long.toString(osmPrimitive.getId()), 255, e.getValue().length()
+                                    key, Long.toString(osmPrimitive.getId()), 255, value.length()
                             ),
                             tr("Precondition Violation"),
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 2905)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 2906)
@@ -47,58 +47,4 @@
     }
 
-    private static class KeysEntry implements Entry<String, String>{
-
-        private final String key;
-        private final String value;
-
-        private KeysEntry(String key, String value) {
-            this.key = key;
-            this.value = value;
-        }
-
-        public String getKey() {
-            return key;
-        }
-
-        public String getValue() {
-            return value;
-        }
-
-        public String setValue(String value) {
-            throw new UnsupportedOperationException();
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((key == null) ? 0 : key.hashCode());
-            result = prime * result + ((value == null) ? 0 : value.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            KeysEntry other = (KeysEntry) obj;
-            if (key == null) {
-                if (other.key != null)
-                    return false;
-            } else if (!key.equals(other.key))
-                return false;
-            if (value == null) {
-                if (other.value != null)
-                    return false;
-            } else if (!value.equals(other.value))
-                return false;
-            return true;
-        }
-    }
-
     private static final int FLAG_MODIFIED = 1 << 0;
     private static final int FLAG_VISIBLE  = 1 << 1;
@@ -556,9 +502,9 @@
         // FIXME: incline=\"-*\" search pattern does not work.
         String reversedDirectionDefault = "oneway=\"-1\" | incline=down | incline=\"-*\"";
-        
+
         String directionDefault = "oneway? | incline=* | aerialway=* | "+
-                                  "waterway=stream | waterway=river | waterway=canal | waterway=drain | waterway=rapids | "+
-                                  "\"piste:type\"=downhill | \"piste:type\"=sled | man_made=\"piste:halfpipe\" | "+
-                                  "junction=roundabout";
+        "waterway=stream | waterway=river | waterway=canal | waterway=drain | waterway=rapids | "+
+        "\"piste:type\"=downhill | \"piste:type\"=sled | man_made=\"piste:halfpipe\" | "+
+        "junction=roundabout";
 
         try {
@@ -846,17 +792,4 @@
     }
 
-    // FIXME: why replying a collection of entries? Should be replaced by
-    // a method Map<String,String> getTags()
-    //
-    public final Collection<Entry<String, String>> entrySet() {
-        if (keys == null || keys.length ==0)
-            return Collections.emptySet();
-        Set<Entry<String, String>> result = new HashSet<Entry<String,String>>();
-        for (int i=0; i<keys.length; i+=2) {
-            result.add(new KeysEntry(keys[i], keys[i+1]));
-        }
-        return result;
-    }
-
     public final Collection<String> keySet() {
         if (keys == null || keys.length == 0)
@@ -910,5 +843,5 @@
      */
     public boolean hasSameTags(OsmPrimitive other) {
-        return entrySet().equals(other.entrySet());
+        return keySet().equals(other.keySet());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 2905)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 2906)
@@ -29,5 +29,4 @@
 import java.util.ConcurrentModificationException;
 import java.util.List;
-import java.util.Map.Entry;
 
 import javax.swing.BorderFactory;
@@ -436,6 +435,6 @@
             }
 
-            for (Entry<String, String> e1 : osm.entrySet()) {
-                text.append("<br>" + e1.getKey() + "=" + e1.getValue());
+            for (String key : osm.keySet()) {
+                text.append("<br>" + key + "=" + osm.get(key));
             }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/ListOfUsedTags.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/ListOfUsedTags.java	(revision 2905)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/ListOfUsedTags.java	(revision 2906)
@@ -70,6 +70,6 @@
 
     private void addPrimitive(OsmPrimitive primitive) {
-        for (Entry<String, String> entry: primitive.entrySet()) {
-            addKey(entry.getKey(), entry.getValue());
+        for (String key: primitive.keySet()) {
+            addKey(key, primitive.get(key));
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 2905)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 2906)
@@ -729,13 +729,14 @@
                 ++ways;
             }
-            for (Entry<String, String> e : osm.entrySet()) {
-                keyCount.put(e.getKey(), keyCount.containsKey(e.getKey()) ? keyCount.get(e.getKey())+1 : 1);
-                if (valueCount.containsKey(e.getKey())) {
-                    Map<String, Integer> v = valueCount.get(e.getKey());
-                    v.put(e.getValue(), v.containsKey(e.getValue())? v.get(e.getValue())+1 : 1 );
+            for (String key: osm.keySet()) {
+                String value = osm.get(key);
+                keyCount.put(key, keyCount.containsKey(key) ? keyCount.get(key) + 1 : 1);
+                if (valueCount.containsKey(key)) {
+                    Map<String, Integer> v = valueCount.get(key);
+                    v.put(value, v.containsKey(value)? v.get(value) + 1 : 1 );
                 } else {
                     TreeMap<String,Integer> v = new TreeMap<String, Integer>();
-                    v.put(e.getValue(), 1);
-                    valueCount.put(e.getKey(), v);
+                    v.put(value, 1);
+                    valueCount.put(key, v);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 2905)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 2906)
@@ -7,5 +7,4 @@
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map.Entry;
 
 import org.openstreetmap.josm.Main;
@@ -40,7 +39,6 @@
         {
             IconElemStyle ret = null;
-            for (Entry<String, String> entry:primitive.entrySet()) {
-                String key = entry.getKey();
-                String val = entry.getValue();
+            for (String key: primitive.keySet()) {
+                String val = primitive.get(key);
                 IconElemStyle style;
                 if((style = icons.get("n" + key + "=" + val)) != null)
@@ -77,7 +75,6 @@
             String linestring = null;
             HashMap<String, LineElemStyle> over = new HashMap<String, LineElemStyle>();
-            for (Entry<String, String> entry:primitive.entrySet()) {
-                String key = entry.getKey();
-                String val = entry.getValue();
+            for (String key: primitive.keySet()) {
+                String val = primitive.get(key);
                 AreaElemStyle styleArea;
                 LineElemStyle styleLine;
