Skip to content

Conversation

@dblevins
Copy link
Contributor

I noticed some differences in behavior on reading vs writing with JsonbTypeAdapters. They appear to have very different code paths and some caching issues that can alter behavior if reads are done after writes.

These test attempt to verify:

  • behavior is the same for both reading and writing
  • consistent order of preference (overriding)

First round of tests cover JsonbTypeAdapter, JsonbTypeDeserializer and JsonbTypeSerializer. Tests that fail are ignored so this can be a passing PR. Inconsistencies are documented.

Don't have time now, but would like to return to this at some point in the future to cover JsonbDateFormat, JsonbNumberFormat and the four flavors of JohnzonConverter. I would also like to test meta-annotation versions of the above.

dblevins added 25 commits May 8, 2025 15:37
Equivalent to Map Adapter Symmetry tests
Config adapter does not win in JsonbTypeAdapter test
Equivalent JsonbTypeAdapter test fails with java.lang.ClassCastException: Cannot cast sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl to java.lang.Class
Equivalent JsonbTypeAdapter test EmailClass adapter wins on write
Equivalent JsonbTypeAdapter test fails with ClassCastException
Equivalent JsonbTypeAdapter test EmailClass adapter wins
@dblevins
Copy link
Contributor Author

dblevins commented May 13, 2025

Discoveries:

Note all tests that fail have been marked @Ignore. The build will succeed if this PR is merged.

@jeanouii jeanouii merged commit f6664f8 into apache:master Nov 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants