Closed qbuzzdaan closed 3 days ago
thanks for the PR.
please follow step 3 to update the samples so that the CI can verify the change.
First commit/PR here, trying my best to follow the steps/guidelines etc :) Ran the commands of steps 3, there are no changes in the samples as it seems.
can you please share a spec to reproduce the issue?
I've added the issue_18975.yaml
spec. Running step 3 again again didn't yield any changes in my repository.
tested locally and the output copmiles without issue. let's give it a try
i'll add a test after merging this PR
thanks again for the PR
Changes how an
StdDeserializer<A>
of a specific typeA
deserializes into anA
. We noticed the static block filling themappings
passed to theJSON.registerDiscriminator(A.class, "type", mappings)
was only called after the first call to the deserializer, causing the first result to have ansetActualInstance
call of the wrong subtype ofA
. This is because the static block is part ofA
, while theStdDeserializer<A>
is a static subclass ofA
. Changing the reference toA.class
into an actual instance ofA
by thenew A().getClass()
causes the static block to be called on time.to fix #18975
PR checklist
(For Windows users, please run the script in Git BASH) Commit all changed files. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
. IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.master
(upcoming 7.6.0 minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08)