[2.9.x] Fix reverse router for OptionalInt/Long/Double query params (backport #14252) by @arimu1 by mergify[bot] · Pull Request #14315 · playframework/playframework · GitHub
Skip to content

[2.9.x] Fix reverse router for OptionalInt/Long/Double query params (backport #14252) by @arimu1 - #14315

Merged
mkurz merged 1 commit into
2.9.xfrom
mergify/bp/2.9.x/pr-14252
Sep 30, 2026
Merged

mkurz merged 1 commit into
2.9.xfrom
mergify/bp/2.9.x/pr-14252

Conversation

@mergify

@mergify mergify Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

  • Have you read How to write the perfect pull request?
  • Have you read through the contributor guidelines?
  • Have you referenced any issues you're fixing using commit message keywords?
  • Have you added copyright headers to new files? (N/A — no new files)
  • Have you checked that both Scala and Java APIs are updated?
  • Have you updated the documentation for both Scala and Java sections? (N/A — bugfix only)
  • Have you added tests for any changed functionality?

Fixes

Fixes #14244

Purpose

Backport of #12995 to the 3.0.x branch. QueryStringBindable for java.util.OptionalInt, OptionalLong, and OptionalDouble used value.toScala.getOrElse(0).toString in unbind, which dropped the query parameter name and produced invalid reversed URLs (e.g. ?111 instead of ?key=111).

The fix delegates unbind to the existing boxed Integer / Long / Double binders when a value is present, matching Optional[T] behavior.

Background Context

This is a straight backport of the merged main-line fix; no API or behavioral changes beyond correcting reverse routing for these Java optional primitive types.

References

Test plan

Backport of #12995: use boxed Integer/Long/Double QueryStringBindable
unbind so reversed URLs include the parameter key.

Fixes #14244

(cherry picked from commit b51910e)
@mkurz mkurz changed the title [2.9.x] [3.0.x] Fix reverse router for OptionalInt/Long/Double query params (backport #14252) by @arimu1 [2.9.x] Fix reverse router for OptionalInt/Long/Double query params (backport #14252) by @arimu1 Sep 30, 2026
@mkurz
mkurz merged commit f90c095 into 2.9.x Sep 30, 2026
15 of 18 checks passed
@mkurz
mkurz deleted the mergify/bp/2.9.x/pr-14252 branch September 30, 2026 10:01
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.

2 participants