Skip to content

Avoid Gson final-field mutation on modern JDKs - #2031

Merged
gcatanese merged 1 commit into
Adyen:mainfrom
gregjotau:fix/gson-final-field-mutation
Aug 24, 2026
Merged

Avoid Gson final-field mutation on modern JDKs#2031
gcatanese merged 1 commit into
Adyen:mainfrom
gregjotau:fix/gson-final-field-mutation

Conversation

@gregjotau

Copy link
Copy Markdown
Contributor

Fixes #2030.

Make the Gson-serialized adyenLibrary field non-final. Gson already mutates this field during deserialization; on JDK 26 that reflective write emits a final-field mutation warning and is scheduled to require explicit opt-in under JEP 500.

The public API remains read-only because no setter is added, and the constructor continues to initialize the SDK name/version.

Verification:

  • mvn -Dtest=SaleToAcquirerDataSerializerTest test — round trip passes and the final-field warning is gone.
  • mvn test -DskipITs — 617 tests, 0 failures/errors, 4 skips on JDK 26.

@gregjotau
gregjotau requested a review from a team as a code owner August 11, 2026 06:23

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the 'final' modifier from the 'adyenLibrary' field in the 'ApplicationInfo' class, making it mutable. There are no review comments, and I have no feedback to provide.

@gcatanese
gcatanese force-pushed the fix/gson-final-field-mutation branch from 2fda4e4 to 847980b Compare August 24, 2026 14:59
@gcatanese

Copy link
Copy Markdown
Contributor

Thank you @gregjotau for your contribution 🎉

@gcatanese
gcatanese enabled auto-merge August 24, 2026 15:01
@gcatanese
gcatanese added this pull request to the merge queue Aug 24, 2026
Merged via the queue into Adyen:main with commit b2d19f5 Aug 24, 2026
6 checks passed
@gregjotau
gregjotau deleted the fix/gson-final-field-mutation branch August 24, 2026 16:11
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.

Avoid Gson mutation of final ApplicationInfo field on modern JDKs

2 participants