Project updates
- Update Maven group id from
org.eclipsetoorg.eclipse.yasson
(PR #729)
Yasson is the last eclipse project to directly publish to theorg.eclipsenamespace. All other projects use their own namespace. We will publish to theorg.eclipse.yassonnamespace going forward and the Eclipse Foundation will work with Sonatype to publish a relocation pom to the old group:archive location.
Bug Fixes
-
NPE when serializing
java.sql.Timestampwith a custom date-time formatter
(PR #725, Issue #577)
SqlTimestampSerializercast its argument toTemporalAccessor, butjava.sql.Timestampdoes not implement that interface, causing aNullPointerExceptionwhenever a custom formatter was configured. The fix convertsTimestamptoInstantbefore formatting, matching the existingjava.util.Dateserialization handling path. -
YassonParser.isIntegralNumber()throwsJsonbExceptioninstead ofIllegalStateException
(PR #710, Issue #707)
The JSON-B specification requiresJsonParser.isIntegralNumber()to throwIllegalStateExceptionwhen the parser state is notVALUE_NUMBER. Yasson incorrectly propagated an internalJsonbException, breaking custom deserializers that caughtIllegalStateExceptionto differentiate numeric from string values. -
Serialization throws
IllegalStateExceptionfor self-referencing generic types
(PR #683, Issue #682)
A prior fix for aStackOverflowErrorinReflectionUtils.resolveTypeArguments()introduced a regression: when the resolved type and the type-to-resolve were identical (e.g., recursive hierarchies likeUniformTree<T extends UniformTree<T>>), anIllegalStateExceptionwas thrown. The fix returns the already-resolved type directly in this case. -
@JsonbTypeSerializernot applied toObject-typed properties with a specific runtime type
(PR #690, Issue #689)
When a property was declared asObjectbut held an instance of a class annotated with@JsonbTypeSerializer, the custom serializer was silently ignored. Yasson now performs runtime type discovery to locate annotation-based serializers, ensuring consistent behaviour regardless of the declared property type. -
@JsonbTypeDeserializer/@JsonbTypeSerializernot recognised for types inside container elements
(PR #686,vIssue #685)
Type-level@JsonbTypeDeserializerand@JsonbTypeSerializerannotations were not applied when the annotated type appeared as an element or value of a container (Map,Collection, array,Optional). The fix ensures the value-type class model is consulted during custom de/serialization for container elements. -
JsonStructureToParserAdapter.getValue()throwsUnsupportedOperationException
(PR #694, Issue #673)
JsonStructureToParserAdapterdid not implement thegetValue()method required by theJsonParserAPI. This caused anUnsupportedOperationExceptionin customJsonbDeserializerimplementations that calledjp.getValue()to handle polymorphic payloads (string or object).
Test Improvements
- Locale-dependent failures in
DocumentationExampleTest
(PR #721, Issue #717)
Number-format tests used the system default locale, causing build failures on non-en_USsystems (e.g.,de_ATwhere the decimal separator is a comma). The locale is now fixed toen_USin the affected test POJOs, and a dedicated CI workflow has been added to verify locale-independent behaviour.
New Contributors
- @jamezp made their first contribution in #661
- @jmini made their first contribution in #667
- @jbaesner made their first contribution in #664
- @KyleAure made their first contribution in #699
- @redmitry made their first contribution in #694
Full Changelog: 3.0.4...3.0.5