Skip to content

Jackson Release 2.18

Tatu Saloranta edited this page Oct 29, 2024 · 105 revisions

Jackson Version 2.18 was released on September 26, 2024. One release candidate (2.18.0-rc1) was released prior to final 2.18.0.

This wiki page gives a list of links to all changes (with brief descriptions) that will be included, as well as about original plans for bigger changes (and in some cases changes to plans, postponing).

Status

Branch is open for patch releases.

Patches

Documentation

Articles, Blog posts

Changes, compatibility

Compatibility: platform requirements

Android

Same as Jackson 2.17, SDK 26

JDK

Same as Jackson 2.17

Kotlin

Kotlin 1.7.x no longer supported (1.8, 1.9, 2.0 are): kotlin#803

JAX-RS

JAX-RS Provides will once again support JAX-RS 1.x as per:

  • #192: Bring back code to support JAXRS v1 (revert #134 for 2.18)

where support had been earlier removed from Jackson 2.13. Support will not continue to 3.0 but is now planned to continue for the rest of 2.x series

Changes, behavior

Avro

As per:

  • Avro#167: Incompatibility with Avro >=1.9.0 (upgrade to Avro 1.11.3)

Avro module now depends on Apache Avro library 1.11.3 (instead of 1.8.2). Update should not affect wire-compatibility, but:

  1. It is important to ensure that the transitive dependency to org.apache.avro:avro has correct version (1.11.3 or higher; but at minimum 1.9.x)
  2. Avro schemas generated with Jackson 2.18 for classes with multiple nesting levels cannot be read with older versions of Jackson Avro module (see issue above for details)

Major focus area(s), final status

Rewrite POJO Property Introspection

  • Has been on top spot of priority lists since at least 2.8 (mentioned in release notes) -- 8 years ago!!!
  • databind#4515 -- fully rewritten POJO (including Record) Property Introspection
    • Solved 5 previously failing unit tests:
      • (only for 3.0) databind#538: Injection when there is cyclic references fails
      • databind#806: Problem with NamingStrategy, creator methods with implicit names
      • databind#2977: Incompatible FAIL_ON_MISSING_PRIMITIVE_PROPERTIES and field level @JsonProperty
      • databind#3241: constructorDetector seems to invalidate defaultSetterInfo for nullability
      • databind#4119: Exception when deserialization uses a record with a constructor property with access=READ_ONLY

Most wanted Features implemented

  • databind#562: Allow @JsonAnySetter to flow through Creators

Performance improvements implemented

  • More optimized JsonParser.getFloatValue() / JsonParser.getDoubleValue(): avoid String creation when calling FastDoubleParser:
    • core#1229: Add char[] versions for NumberInput parseFloat, parseDouble, parseBigInteger
    • core#1284: Optimize JsonParser.getDoubleValue()/getFloatValue()/getDecimalValue() to avoid String allocation

Most wanted Features considered but not implemented

Following features were considered for implementation but did not get implemented for this version


Full Change list

Changes, core

  • No changes since 2.17
  • #223: UTF8JsonGenerator writes supplementary characters as a surrogate pair -- should use 4-byte encoding
  • #1230: Improve performance of float and double parsing from TextBuffer
  • #1251: InternCache - replace synchronized with ReentrantLock
  • #1252: ThreadLocalBufferManager replace synchronized with ReentrantLock
  • #1257: Increase InternCache default max size from 100 to 200
  • #1262: Add diagnostic method pooledCount() in RecyclerPool
  • #1264: Rename shaded ch.randelshofer:fastdoubleparser classes to prevent use by downstream consumers
  • #1271: Deprecate LockFreePool implementation in 2.18 (remove from 3.0)
  • #1274: NUL-corrupted keys, values on JSON serialization
  • #1277: Add back Java 22 optimisation in FastDoubleParser
  • #1284: Optimize JsonParser.getDoubleValue()/getFloatValue()/getDecimalValue() to avoid String allocation
  • #1310: Add new StreamReadConstraints (maxTokenCount) to limit maximum number of Tokens allowed per document
  • #1331: Update to FastDoubleParser v1.0.1 to fix BigDecimal decoding problem
  • #1340: Missing JsonFactory "provides" SPI with JPMS in jackson-core module
  • #562: Allow @JsonAnySetter to flow through Creators
  • #806: Problem with NamingStrategy, creator methods with implicit names
  • #2977: Incompatible FAIL_ON_MISSING_PRIMITIVE_PROPERTIES and field level @JsonProperty
  • #3241: constructorDetector seems to invalidate defaultSetterInfo for nullability
  • #3439: Java Record @JsonAnySetter value is null after deserialization
  • #4119: Exception when deserialization uses a record with a constructor property with access=READ_ONLY
  • #4356: BeanDeserializerModifier::updateBuilder() doesn't work for beans with Creator methods
  • #4407: null type id handling does not work with writeTypePrefix()
  • #4452: @JsonProperty not serializing field names properly on @JsonCreator in Record
  • #4453: Allow JSON Integer to deserialize into a single-arg constructor of parameter type double
  • #4456: Rework locking in DeserializerCache
  • #4458: Rework synchronized block from BeanDeserializerBase
  • #4464: When Include.NON_DEFAULT setting is used, isEmpty() method is not called on the serializer
  • #4472: Rework synchronized block in TypeDeserializerBase
  • #4483: Remove final on method BeanSerializer.serialize()
  • #4515: Rewrite Bean Property Introspection logic in Jackson 2.x
  • #4570: Deprecate ObjectMapper.canDeserialize()/ObjectMapper.canSerialize()
  • #4580: Add MapperFeature.SORT_CREATOR_PROPERTIES_BY_DECLARATION_ORDER to use Creator properties' declaration order for sorting
  • #4584: Provide extension point for detecting "primary" Constructor for Kotlin (and similar) data classes
  • #4602: Possible wrong use of _arrayDelegateDeserializer in BeanDeserializerBase::deserializeFromObjectUsingNonDefault()
  • #4617: Record property serialization order not preserved
  • #4634: @JsonAnySetter not working when annotated on both constructor parameter & field
  • #4678: Java records don't serialize with MapperFeature.REQUIRE_SETTERS_FOR_GETTERS since 2.16
  • #4688: Should allow deserializing with no-arg @JsonCreator(mode = DELEGATING)
  • #4699: Add extra writeNumber() method in TokenBuffer
  • #4709: Add JacksonCollectors with toArrayNode() implementation

Changes, data formats

  • #167: Incompatibility with Avro >=1.9.0 (upgrade to Avro 1.11.3)
  • #494: Avro Schema generation: allow mapping Java Enum properties to Avro String values
  • #508: Ignore specificData field on serialization
  • #442: Allow use of "value decorators" (like [ and ] for arrays) for reading CsvSchema columns
  • #468: Remove synchronization from CsvMapper
  • #469: Allow CSV to differentiate between null and empty fields (foo,,bar vs. foo,"",bar)
  • #483: Incorrect location of CSV errors
  • #485: CSVDecoder: No Long and Int out of range exceptions
  • #495: Support use of CsvValueDecorator for writing CSV column values
  • #509: IonValueMapper.builder() not implemented, does not register modules
  • #484: Rework synchronization in ProtobufMapper
  • #482: Allow passing ParserImpl by a subclass or overwrite the events

Changes, datatypes

Guava

  • #160: Defect wrt guava OSGi dependency version specified

Changes, Other modules

Android Records

  • #248: jClass annotations and polymorphic types are ignored when deserializing Android Record fields
  • #251: Constructor is not recognized when a record uses both arrays and generic types

JAXB Annotations

  • #233: Tolerate JAX-RS 2.2 in jackson-module-jaxb-annotations so that it can be deployed in Liberty alongside features which use 2.2

Changes, JVM Languages

  • #542: Remove meaningless checks and properties in KNAI.
  • #782: Content marked as deprecated has been reorganized. Several constructors and accessors to properties of KotlinModule.Builder that were marked as DeprecationLevel.ERROR have been removed. Also, the content marked as DeprecationLevel.WARNING is now DeprecationLevel.ERROR.
  • #803: Update Kotlin version; remove support for 1.7
  • #817: The convertValue extension function now accepts null
  • #818: The implementation of the search process for the JsonCreator (often the primary constructor) used by default for deserialization has been changed to AnnotationIntrospector#findDefaultCreator. This has improved first-time processing performance and memory usage. It also solves the problem of findCreatorAnnotation results by AnnotationIntrospector registered by the user being ignored depending on the order in which modules are registered.

Changes, Providers

  • #192: Bring back code to support JAXRS v1 (revert #134 for 2.18)
  • #193: JacksonJsonProvider has @Produces(MediaType.WILDCARD) and yet hasMatchingMediaType(MediaType.WILDCARD) return false
  • #30: JacksonJsonProvider has @Produces(MediaType.WILDCARD) and yet hasMatchingMediaType(MediaType.WILDCARD) return false

Changes, other

  • #162: Add support for deserializing Java Records
Clone this wiki locally