diff --git a/router/java/src/com/maxmind/geoip2/DatabaseReader.java b/router/java/src/com/maxmind/geoip2/DatabaseReader.java index c3b97cca50..879c573893 100644 --- a/router/java/src/com/maxmind/geoip2/DatabaseReader.java +++ b/router/java/src/com/maxmind/geoip2/DatabaseReader.java @@ -1,12 +1,7 @@ package com.maxmind.geoip2; -import com.fasterxml.jackson.databind.*; -import com.fasterxml.jackson.databind.node.ObjectNode; import com.maxmind.db.*; import com.maxmind.db.Reader.FileMode; -import com.maxmind.geoip2.exception.AddressNotFoundException; -import com.maxmind.geoip2.exception.GeoIp2Exception; -import com.maxmind.geoip2.model.*; import java.io.Closeable; import java.io.File; @@ -15,8 +10,11 @@ import java.io.InputStream; import java.net.InetAddress; import java.util.Collections; import java.util.List; +import java.util.Map; /** + * Modified and simplified for I2P + * *

* The class {@code DatabaseReader} provides a reader for the GeoIP2 database * format. @@ -50,13 +48,13 @@ import java.util.List; * {@code com.maxmind.db.CHMCache}. Using this cache, lookup performance is * significantly improved at the cost of a small (~2MB) memory overhead. *

+ * + * @since 0.9.38 */ -public class DatabaseReader implements DatabaseProvider, Closeable { +public class DatabaseReader implements Closeable { private final Reader reader; - private final ObjectMapper om; - private final List locales; private DatabaseReader(Builder builder) throws IOException { @@ -70,12 +68,6 @@ public class DatabaseReader implements DatabaseProvider, Closeable { throw new IllegalArgumentException( "Unsupported Builder configuration: expected either File or URL"); } - this.om = new ObjectMapper(); - this.om.configure(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS, false); - this.om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, - false); - this.om.configure( - DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true); this.locales = builder.locales; } @@ -162,13 +154,31 @@ public class DatabaseReader implements DatabaseProvider, Closeable { } /** + * Returns a map containing: + * + *