Skip to content

Fix handling of null predicate in Specification.not() #3856

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

Closed
wants to merge 1 commit into from

Conversation

SWQXDBA
Copy link
Contributor

@SWQXDBA SWQXDBA commented Apr 23, 2025

When toPredicate() returns null, Specification.not() now returns builder.disjunction() instead of builder.not(null). This change ensures proper handling of null predicates in negated specifications.

Closes #3849

spring-projects#3849

When toPredicate() returns null, Specification.not() now returns
builder.disjunction() instead of builder.not(null). This change
ensures proper handling of null predicates in negated specifications.

Signed-off-by: SWQXDBA <983110853@qq.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 23, 2025
@mp911de mp911de self-assigned this Apr 23, 2025
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 23, 2025
@mp911de mp911de added this to the 3.3.12 (2024.0.12) milestone May 5, 2025
mp911de pushed a commit that referenced this pull request May 5, 2025
When toPredicate() returns null, Specification.not() now returns
builder.disjunction() instead of builder.not(null). This change
ensures proper handling of null predicates in negated specifications.

Closes #3849
Original pull request: #3856

Signed-off-by: SWQXDBA <983110853@qq.com>
mp911de added a commit that referenced this pull request May 5, 2025
Reformat code. Refine tests.

See #3849
Original pull request: #3856
mp911de pushed a commit that referenced this pull request May 5, 2025
When toPredicate() returns null, Specification.not() now returns
builder.disjunction() instead of builder.not(null). This change
ensures proper handling of null predicates in negated specifications.

Closes #3849
Original pull request: #3856

Signed-off-by: SWQXDBA <983110853@qq.com>
mp911de added a commit that referenced this pull request May 5, 2025
Reformat code. Refine tests.

See #3849
Original pull request: #3856
mp911de pushed a commit that referenced this pull request May 5, 2025
When toPredicate() returns null, Specification.not() now returns
builder.disjunction() instead of builder.not(null). This change
ensures proper handling of null predicates in negated specifications.

Closes #3849
Original pull request: #3856

Signed-off-by: SWQXDBA <983110853@qq.com>
mp911de added a commit that referenced this pull request May 5, 2025
Reformat code. Refine tests.

See #3849
Original pull request: #3856
mp911de pushed a commit that referenced this pull request May 5, 2025
When toPredicate() returns null, Specification.not() now returns
builder.disjunction() instead of builder.not(null). This change
ensures proper handling of null predicates in negated specifications.

Closes #3849
Original pull request: #3856

Signed-off-by: SWQXDBA <983110853@qq.com>
mp911de added a commit that referenced this pull request May 5, 2025
Add fix to Update, Delete, and PredicateSpecification. Reformat code. Refine tests.

See #3849
Original pull request: #3856
@mp911de
Copy link
Member

mp911de commented May 5, 2025

Thank you for your contribution. That's merged, polished, and backported now.

@mp911de mp911de closed this May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specification.not() fails with NullPointerException when other Specification returns null
3 participants