Skip to content

Handle primitive array form values without reference-array casts - #3608

Merged
velo merged 3 commits into
OpenFeign:masterfrom
hutiefang76:frank/feign-expansion-20261007-01a11186
Oct 7, 2026
Merged

velo merged 3 commits into
OpenFeign:masterfrom
hutiefang76:frank/feign-expansion-20261007-01a11186

Conversation

@hutiefang76

Copy link
Copy Markdown
Contributor

Form values such as int[] pass the array check but then throw ClassCastException when URL-encoded and multipart processors cast them to Object[].

Read array elements through java.lang.reflect.Array, preserving URL-encoded CollectionFormat and existing multipart writer ordering. Numeric and boolean multipart arrays produce repeated scalar parts; byte[] retains its existing single binary part. Reference arrays, collections and scalar behavior remain covered.

Fixes #3607.

Validation in a standalone checkout on JDK 26:

  • Original source: 24 focused tests, 16 primitive-array cast errors.
  • Patched source: all 24 focused tests pass.
  • ./mvnw -q -Pdev -Dtoolchain.skip=true -Dmaven.compiler.proc=full -pl form -am verify: 882 tests passed, 4 skipped across core, jackson and form; license and formatting checks enabled.
  • proc=full enables Lombok processing on the installed JDK; main source retains the project's Java 8 target. This is affected-module validation, not an all-module build.

AI assistance: DeepSeek assisted implementation, tests and initial review; Codex coordinated validation and submission.

Read primitive and reference array elements through Array, retaining collection formatting and multipart binary writer priority. Add encoder regressions and a changelog entry.

Fixes OpenFeign#3607
velo added 2 commits October 7, 2026 18:03
…old primitive-array tests into existing suites

Signed-off-by: Marvin Froeder <velo.br@gmail.com>
Signed-off-by: Marvin Froeder <velo.br@gmail.com>
@velo
velo merged commit 41436be into OpenFeign:master Oct 7, 2026
3 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.

Primitive array form fields throw ClassCastException during encoding

2 participants