Index: trunk/src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java	(revision 14960)
+++ trunk/src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java	(revision 14961)
@@ -192,4 +192,19 @@
      */
     public ChangesetDataSetEntry getFirstEntry(PrimitiveId id) {
+        return getEntry(id, 0);
+    }
+
+    /**
+     * Replies the last {@link ChangesetDataSetEntry} with id <code>id</code> from this dataset.
+     * null, if there is no such primitive in the data set.
+     * @param id the id
+     * @return the last {@link ChangesetDataSetEntry} with id <code>id</code> from this dataset or null.
+     * @since 14946
+     */
+    public ChangesetDataSetEntry getLastEntry(PrimitiveId id) {
+        return getEntry(id, 1);
+    }
+
+    private ChangesetDataSetEntry getEntry(PrimitiveId id, int n) {
         if (id == null)
             return null;
@@ -199,26 +214,5 @@
         if (val instanceof ChangesetDataSetEntry[]) {
             ChangesetDataSetEntry[] entries = (ChangesetDataSetEntry[]) val;
-            return entries[0];
-        } else {
-            return (ChangesetDataSetEntry) val;
-        }
-    }
-
-    /**
-     * Replies the last {@link ChangesetDataSetEntry} with id <code>id</code> from this dataset.
-     * null, if there is no such primitive in the data set.
-     * @param id the id
-     * @return the last {@link ChangesetDataSetEntry} with id <code>id</code> from this dataset or null.
-     * @since 14946
-     */
-    public ChangesetDataSetEntry getLastEntry(PrimitiveId id) {
-        if (id == null)
-            return null;
-        Object val = entryMap.get(id);
-        if (val == null)
-            return null;
-        if (val instanceof ChangesetDataSetEntry[]) {
-            ChangesetDataSetEntry[] entries = (ChangesetDataSetEntry[]) val;
-            return entries[1];
+            return entries[n];
         } else {
             return (ChangesetDataSetEntry) val;
