Skip to content

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

Open
gregjotau wants to merge 1 commit into
Adyen:mainfrom
gregjotau:fix/gson-final-field-mutation
Open

Avoid Gson final-field mutation on modern JDKs#2031
gregjotau wants to merge 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.

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

1 participant