Skip to content

SLING-13138 Add configurable fail-fast parameter limit handling#74

Open
aswinad wants to merge 3 commits intoapache:masterfrom
aswinad:improve/parameter-limit-fail-fast
Open

SLING-13138 Add configurable fail-fast parameter limit handling#74
aswinad wants to merge 3 commits intoapache:masterfrom
aswinad:improve/parameter-limit-fail-fast

Conversation

@aswinad
Copy link
Copy Markdown
Contributor

@aswinad aswinad commented Mar 16, 2026

SLING-13138
Improve request parameter limit handling in ParameterMap.

This change updates the parameter limit check from size() == maxParameters
to size() >= maxParameters for more defensive boundary handling.

It also introduces an optional configuration to control behavior when the
configured parameter limit is exceeded:

  • default: log a warning and ignore additional parameters
  • fail-fast mode: throw IllegalStateException immediately

The default behavior remains unchanged for backward compatibility.

Unit tests are included for both modes.

Copy link
Copy Markdown
Contributor

@joerghoh joerghoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

although I have never seen that warning being written (highly doubt that as the default size is 10k), so I question a bit the value of it. But fixing TODOs is definitely good.

@aswinad
Copy link
Copy Markdown
Contributor Author

aswinad commented Mar 17, 2026

Thanks! The main goal here was addressing the TODO and making the behavior configurable.

@sonarqubecloud
Copy link
Copy Markdown

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