Index: trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java	(revision 17746)
+++ trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java	(revision 17747)
@@ -50,4 +50,5 @@
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
 import org.openstreetmap.josm.tools.AlphanumComparator;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Geometry;
 import org.openstreetmap.josm.tools.Logging;
@@ -195,21 +196,5 @@
                             return new KeyValue(keyword, rangeS.trim(), regexSearch, caseSensitive);
                         } else if (rangeA.length == 2) {
-                            String rangeA1 = rangeA[0].trim();
-                            String rangeA2 = rangeA[1].trim();
-                            final long minDate;
-                            final long maxDate;
-                            try {
-                                // if min timestamp is empty: use lowest possible date
-                                minDate = DateUtils.fromString(rangeA1.isEmpty() ? "1980" : rangeA1).getTime();
-                            } catch (UncheckedParseException | DateTimeException ex) {
-                                throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA1), ex);
-                            }
-                            try {
-                                // if max timestamp is empty: use "now"
-                                maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime();
-                            } catch (UncheckedParseException | DateTimeException ex) {
-                                throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA2), ex);
-                            }
-                            return new TimestampRange(minDate, maxDate);
+                            return TimestampRange.create(rangeA);
                         } else {
                             throw new SearchParseError("<html>" + tr("Expecting {0} after {1}", "<i>min</i>/<i>max</i>", "<i>timestamp</i>")
@@ -1500,4 +1485,25 @@
         }
 
+        private static TimestampRange create(String[] range) throws SearchParseError {
+            CheckParameterUtil.ensureThat(range.length == 2, "length 2");
+            String rangeA1 = range[0].trim();
+            String rangeA2 = range[1].trim();
+            final long minDate;
+            final long maxDate;
+            try {
+                // if min timestamp is empty: use lowest possible date
+                minDate = DateUtils.fromString(rangeA1.isEmpty() ? "1980" : rangeA1).getTime();
+            } catch (UncheckedParseException | DateTimeException ex) {
+                throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA1), ex);
+            }
+            try {
+                // if max timestamp is empty: use "now"
+                maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime();
+            } catch (UncheckedParseException | DateTimeException ex) {
+                throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA2), ex);
+            }
+            return new TimestampRange(minDate, maxDate);
+        }
+
         @Override
         protected Long getNumber(OsmPrimitive osm) {
