Skip to content

Releases: maxmind/MaxMind-DB-Reader-java

4.0.0

10 Nov 21:36
73d600c

Choose a tag to compare

This is a major release with several breaking changes. Please see
UPGRADING.md for detailed migration instructions.

  • Java 17 or greater is now required.
  • Added support for MaxMind DB files larger than 2GB. The library now uses
    an internal Buffer abstraction that can handle databases exceeding the
    2GB ByteBuffer limit. Files under 2GB continue to use a single ByteBuffer
    for optimal performance. Requested by nonetallt. GitHub #154. Fixed by
    Silvano Cerza. GitHub #289.
  • Metadata.getBuildDate() has been replaced with buildTime(), which returns
    java.time.Instant instead of java.util.Date. The instant represents the
    database build time in UTC.
  • DatabaseRecord, Metadata, Network, and internal DecodedValue classes
    have been converted to records. The following API changes were made:
    • DatabaseRecord.getData() and DatabaseRecord.getNetwork() have been
      replaced with record accessor methods data() and network().
    • Simple getter methods on Metadata (e.g., getBinaryFormatMajorVersion(),
      getDatabaseType(), etc.) have been replaced with their corresponding record
      accessor methods (e.g., binaryFormatMajorVersion(), databaseType(), etc.).
    • Network.getNetworkAddress() and Network.getPrefixLength() have been
      replaced with record accessor methods networkAddress() and prefixLength().
    • Removed the legacy DatabaseRecord(T, InetAddress, int) constructor; pass a
      Network when constructing records manually.
  • Deserialization improvements:
    • If no constructor is annotated with @MaxMindDbConstructor, records now
      use their canonical constructor automatically. For non‑record classes with
      a single public constructor, that constructor is used by default.
    • @MaxMindDbParameter annotations are now optional when parameter names
      match field names in the database: for records, component names are used;
      for classes, Java parameter names are used (when compiled with
      -parameters). Annotations still take precedence when present.
    • Added @MaxMindDbIpAddress and @MaxMindDbNetwork annotations to inject
      the lookup IP address and resulting network into constructors. Annotation
      metadata is cached per type to avoid repeated reflection overhead.

3.2.0

28 May 20:23
9b79027

Choose a tag to compare

  • First release using Central Portal instead of Legacy OSSRH.
  • Improve internal uses of types and other code cleanups. Pull requests
    by Philippe Marschall. GitHub #246, #247, #248, and #249.

3.1.1

19 Sep 22:26
6575204

Choose a tag to compare

  • When handling a deserialization exception, the decoder now avoids
    throwing a NullPointerException when one of the constructor arguments
    is null. Reported by Keith Massey. GitHub #164.

3.1.0

05 Dec 18:07
251f956

Choose a tag to compare

  • Reader supports iterating over the whole database or within a network.

3.0.0

12 Dec 17:04
a137f39

Choose a tag to compare

  • Java 11 or greater is now required.
  • This library is now a Java module.

2.1.0

31 Oct 19:18
ba08435

Choose a tag to compare

  • Messages for DeserializationException have been improved, and the cause
    is included, if any. Moreover, the message provides detail about the involved
    types, if the exception is caused by an IllegalArgumentException.

2.0.0

13 Oct 20:43

Choose a tag to compare

  • No changes since 2.0.0-rc2.

2.0.0-rc2

29 Sep 16:44

Choose a tag to compare

  • Build using the --release command-line option so linking when using
    Java 8 works.

2.0.0-rc1

24 Sep 18:08

Choose a tag to compare

  • Significant API changes. The get() and getRecord() methods now take a
    class parameter specifying the type of object to deserialize into. You
    can either deserialize into a Map or to model classes that use the
    MaxMindDbConstructor and MaxMindDbParameter annotations to identify
    the constructors and parameters to deserialize into.
  • jackson-databind is no longer a dependency.
  • The Record class is now named DatabaseRecord. This is to avoid a
    conflict with java.lang.Record in Java 14.

1.4.0

12 Jun 22:01

Choose a tag to compare

  • IMPORTANT: Java 8 is now required. If you need Java 7 support, please
    continue using 1.3.1 or earlier.
  • The decoder will now throw an InvalidDatabaseException on an invalid
    control byte in the data section rather than an
    ArrayIndexOutOfBoundsException. Reported by Edwin Delgado H. GitHub
    #68.
  • In order to improve performance when lookups are done from multiple
    threads, a use of synchronized has been removed. GitHub #65 & #69.
  • jackson-databind has been upgraded to 2.11.0.