Skip to content

Latest commit

 

History

History
249 lines (192 loc) · 9.25 KB

File metadata and controls

249 lines (192 loc) · 9.25 KB

CHANGELOG

4.0.2 (2025-12-08)

  • Fixed a bug where enums with @MaxMindDbCreator would throw ConstructorNotFoundException when the data was stored via a pointer in the database. This commonly occurred with deduplicated data in larger databases. Reported by Fabrice Bacchella. GitHub #644 in GeoIP2-java.
  • Improved error messages when constructor invocation fails. The error now correctly identifies null values being passed to primitive parameters instead of reporting misleading boxed/primitive type mismatches.

4.0.1 (2025-12-02)

  • DecodedValue is now a public class again, allowing custom NodeCache implementations to be created. The class was inadvertently made package-private in 4.0.0. Reported by Alexandros Leventakis. GitHub #321.

4.0.0 (2025-11-10)

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 (2025-05-28)

  • 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 (2024-09-19)

  • 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 (2023-12-05)

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

3.0.0 (2022-12-12)

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

2.1.0 (2022-10-31)

  • 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 (2020-10-13)

  • No changes since 2.0.0-rc2.

2.0.0-rc2 (2020-09-29)

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

2.0.0-rc1 (2020-09-24)

  • 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 (2020-06-12)

  • 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.

1.3.1 (2020-03-03)

  • Correctly decode strings that are between 157 and 288 bytes long. 1.3.0 introduced a regression when decoding these due to using a signed byte as an unsigned value. Reported by Dongmin Yu. GitHub #181 in maxmind/GeoIP2-java.
  • Update jackson-databind dependency.

1.3.0 (2019-12-13)

  • IMPORTANT: Java 7 is now required. If you need Java 6 support, please continue using 1.2.2 or earlier.
  • The method getRecord was added to com.maxmind.db.Reader. This method returns a com.maxmind.db.Record object that includes the data for the record as well as the network associated with the record.

1.2.2 (2017-02-22)

  • Remove the version range. As of today, jackson-databind is no longer resolved correctly when a range is used. GitHub #28.

1.2.1 (2016-04-15)

  • Specify a hard minimum dependency for jackson-databind. This API will not work with versions earlier than 2.7.0, and Maven's nearest-first resolution rule often pulled in older versions.

1.2.0 (2016-01-13)

  • JsonNode containers returned by the get(ip) are now backed by unmodifiable collections. Any mutation done to them will fail with an UnsupportedOperationException exception. This allows safe caching of the nodes to be done without doing a deep copy of the cached data. Pull request by Viktor Szathmáry. GitHub #24.

1.1.0 (2016-01-04)

  • The reader now supports pluggable caching of the decoded data. By default, no caching is performed. Please see the README.md file or the API docs for information on how to enable caching. Pull requests by Viktor Szathmáry. GitHub #21.
  • This release also includes several additional performance enhancements as well as code cleanup from Viktor Szathmáry. GitHub #18, #19, #20, #22,and #23.

1.0.1 (2015-12-17)

  • Several optimizations have been made to reduce allocations when decoding a record. Pull requests by Viktor Szathmáry. GitHub #16 & #17.

1.0.0 (2014-09-29)

  • First production release.

0.4.0 (2014-09-23)

  • Made com.maxmind.db.Metadata public and added public getters for most of the interesting metadata. This is accessible through the getMetadata() method on a Reader object.

0.3.4 (2014-08-27)

  • Previously the Reader would hold onto the underlying file and FileChannel, not closing them until the Reader was closed. This was unnecessary; they are now closed immediately after they are used. Fix by Andrew Snare; GitHub issue #7.
  • The Reader now discards the reference to the underlying buffer when close() is called. This is done to help ensure that the buffer is garbage collected sooner, which may mitigate file locking issues that some users have experienced on Windows when updating the database. Patch by Andrew Snare; GitHub issue #8.

0.3.3 (2014-06-02)

  • A potential (small) resource leak when using this library with a thread pool was fixed.

0.3.2 (2014-04-02)

  • Added tests and documentation for multi-threaded use.

0.3.1 (2013-11-05)

  • An InputStream constructor was added to the Reader class. This reads the stream into memory as if it was using FileMode.MEMORY. Patch by Matthew Daniel.
  • The source code is now attached during packaging. Patch by Matthew Daniel.
  • The artifact ID was changed to maxmind-db in order to increase naming consistency.

0.3.0 (2013-10-17)

  • IMPORTANT: The package name was changed to com.maxmind.db. The MaxMindDbReader class was renamed to Reader.
  • Improved error handling and test coverage.
  • Performance improvements.

0.2.0 (2013-07-08)

  • The reader and database format now uses IEEE 754 doubles and floats.
  • FileMode.IN_MEMORY was renamed to FileMode.MEMORY.
  • Cache Type enum values array.

0.1.0 (2013-06-14)

  • Initial release