From af49cbb232a46b1af07ed43551c5c07fc26bfe2f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 8 Oct 2015 23:10:00 +1300 Subject: Add Ulbotech unit test case --- src/org/traccar/geocode/JsonReverseGeocoder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/geocode/JsonReverseGeocoder.java b/src/org/traccar/geocode/JsonReverseGeocoder.java index 88150a299..6f4b5dcd2 100644 --- a/src/org/traccar/geocode/JsonReverseGeocoder.java +++ b/src/org/traccar/geocode/JsonReverseGeocoder.java @@ -17,15 +17,14 @@ package org.traccar.geocode; import com.ning.http.client.AsyncCompletionHandler; import com.ning.http.client.Response; -import org.traccar.Context; - -import javax.json.Json; -import javax.json.JsonObject; -import javax.json.JsonReader; import java.util.AbstractMap; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonReader; +import org.traccar.Context; public abstract class JsonReverseGeocoder implements ReverseGeocoder { @@ -37,6 +36,7 @@ public abstract class JsonReverseGeocoder implements ReverseGeocoder { this.url = url; if (cacheSize > 0) { this.cache = Collections.synchronizedMap(new LinkedHashMap, String>() { + @Override protected boolean removeEldestEntry(Map.Entry eldest) { return size() > cacheSize; } -- cgit v1.2.3