Skip to content

Fix writing collections where first element is null#2218

Closed
tamland wants to merge 1 commit into
spring-projects:mainfrom
tamland:fix-null-in-collections
Closed

Fix writing collections where first element is null#2218
tamland wants to merge 1 commit into
spring-projects:mainfrom
tamland:fix-null-in-collections

Conversation

@tamland

@tamland tamland commented Jan 13, 2026

Copy link
Copy Markdown

This is a fix for #2215. It is unclear to me what the code checking the class of the first element is supposed to solve as there appear to be no tests covering its behavior.

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 13, 2026
@tamland tamland force-pushed the fix-null-in-collections branch from 3daa844 to 3f735de Compare January 13, 2026 12:23
@tamland

tamland commented Jun 15, 2026

Copy link
Copy Markdown
Author

@mp911de / @schauder Could you have a look at this? We are unable to upgrade from spring boot 3.4 due to this issue

@schauder schauder self-assigned this Jul 1, 2026
@schauder

schauder commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

When rebased against current main the test you added does not work with Postgres. Also saveAndLoadListOfDirectionAsArray fails with Postgres.

To run all tests using Postgres as the database run ./mvnw clean verify -Dspring.profiles.active=postgres

To run all tests with all databases run ./mvnw clean verify -Pall-dbs

Let us know if you want to keep working on this PR, or if we should close it.

@schauder schauder added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 1, 2026
@tamland tamland force-pushed the fix-null-in-collections branch 2 times, most recently from ad02587 to db5c5b2 Compare July 1, 2026 11:43
@tamland

tamland commented Jul 1, 2026

Copy link
Copy Markdown
Author

@schauder Thanks, I was just running the default test config which clearly didn't do anything.

I have updated the PR to at least fix the issue for simple array types. However, I am unable find a good solution for EntityWithDirections where custom enum converter are used.

Closes spring-projects#2215

Signed-off-by: Thomas Amland <thomas.amland@gmail.com>
@tamland tamland force-pushed the fix-null-in-collections branch from db5c5b2 to 7a7c0f3 Compare July 1, 2026 11:47
@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jul 1, 2026
@schauder

schauder commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

That is unfortunate.
Thanks for trying.

@schauder schauder closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: feedback-provided Feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants