Skip to content

fix: avoid per-request String.format in context decorators (#6805) - #6969

Open
yykaue wants to merge 2 commits into
apache:masterfrom
yykaue:fix-6805-context-decorator-format
Open

fix: avoid per-request String.format in context decorators (#6805)#6969
yykaue wants to merge 2 commits into
apache:masterfrom
yykaue:fix-6805-context-decorator-format

Conversation

@yykaue

@yykaue yykaue commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #6805.

Summary

  • Precompute the default module names for the Divide and WebSocket context decorators.
  • Remove per-request String.format calls from the request path.
  • Add an assertion covering the default Divide module name.
  • Preserve the existing module naming behavior.

Optional.orElse(...) evaluates its fallback value eagerly, so the previous String.format was executed on every request, even when metadata contained an application name. Using static constants avoids this unnecessary formatting and allocation.

@Aias00, could you please help review this PR when you have time? Thank you!

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

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.

[BUG] — Divide/WebSocket context decorators: String.format per request

1 participant