Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix: FlatFileItemWriterBuilder - Ensure names() is respected for RecordFieldExtractor #4936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DevSeongmin wants to merge 1 commit into spring-projects:main
base: main
Choose a base branch
Loading
from DevSeongmin:GH-4935

Conversation

Copy link

@DevSeongmin DevSeongmin commented Aug 4, 2025

Description
When using FlatFileItemWriterBuilder with Java Record types, specifying .names() is currently required, but RecordFieldExtractor ignores those names due to a missing .setNames() call. This causes all record components to be extracted regardless of the .names() setting, leading to unexpected behavior.

This patch fixes the issue by invoking .setNames() on RecordFieldExtractor when names are specified, aligning its behavior with BeanWrapperFieldExtractor used for non-record types.

No breaking changes are introduced.

Changes
Added .setNames() call on newly created RecordFieldExtractor if names are provided.

Maintains consistency and backward compatibility in builder API.

Motivation
Enables partial field extraction from Java Records via .names() method, matching the behavior for Java Beans.

Resolves a long-standing inconsistency and confusion reported by users and educators.

Additional Notes
Powerd by KILL-9 💀

Related Issue
This PR addresses issue #4935

...or Java Record types
Signed-off-by: DevSeongmin <hsm990423@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /