Skip to content

Consider explicitly bound paths visible in QuerydslBindings - #3557

Open
sharanggupta wants to merge 1 commit into
spring-projects:mainfrom
sharanggupta:gh-3547-explicit-bindings-exclusion
Open

sharanggupta wants to merge 1 commit into
spring-projects:mainfrom
sharanggupta:gh-3547-explicit-bindings-exclusion

Conversation

@sharanggupta

Copy link
Copy Markdown
  • 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).

QuerydslBindings.getPropertyPath(…) evaluated visibility before looking up explicit bindings, and without the owning type, so a path registered via bind(…) was treated like any unlisted property. With excludeUnlistedProperties(true) — or an allowlist that doesn't name it — the binding was hidden, although the Javadoc of excludeUnlistedProperties(…) says explicitly bound properties stay available. Aliased bindings were unaffected, which made exclusion inconsistent between aliased and non-aliased bindings.

Visibility is now checked against the owning type first: an explicitly bound path is visible unless explicitly excluded, mirroring the existing alias rule. Unbound paths keep the previous allowlist/denylist semantics.

Tests: four new unit tests in QuerydslBindingsUnitTests (three fail on main, the fourth pins the alias/deny behaviour); full module suite green (3872 tests).

Closes #3547

QuerydslBindings.getPropertyPath(…) decided path visibility before looking up explicit bindings and did so without knowing the owning type, so a path registered via bind(…) was treated like any unlisted property. With excludeUnlistedProperties(true), or with an allowlist that didn't name the bound path, the binding was hidden although the Javadoc of excludeUnlistedProperties(…) promises that explicitly bound properties stay available. Aliased bindings were not affected, which made the exclusion evaluation inconsistent between aliased and non-aliased bindings.

Visibility is now evaluated against the owning type first: a path with an explicit binding is visible unless it has been explicitly excluded, mirroring the existing rule for aliases. Unbound paths keep the previous allowlist/denylist semantics.

Closes spring-projects#3547

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent Querydsl bindings exclusion evaluation

3 participants