Skip to content

Fix URIBuilder encoding policy documentation and null reset - #696

Merged
ok2c merged 1 commit into
apache:masterfrom
prafgup:prafulg/correct-URIBuilder-doc
Sep 12, 2026
Merged

Fix URIBuilder encoding policy documentation and null reset#696
ok2c merged 1 commit into
apache:masterfrom
prafgup:prafulg/correct-URIBuilder-doc

Conversation

@prafgup

@prafgup prafgup commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

URIBuilder defaults to ALL_RESERVED, but setEncodingPolicy's Javadoc incorrectly identifies RFC_3986 as the default. Passing null also selects RFC_3986 behavior instead of restoring the documented default.

This change corrects the Javadoc and makes null restore ALL_RESERVED.

Incorrect doc -

  • /**
    * Sets the encoding policy for this {@link URIBuilder}.
    * The encoding policy determines how URI components (e.g., query, fragment) are
    * percent-encoded when building the URI string. If not set, the default policy
    * is {@link EncodingPolicy#RFC_3986}.
    *
    * @param encodingPolicy the encoding policy to apply, or {@code null} to reset
    * to the default ({@link EncodingPolicy#ALL_RESERVED})
    * @return this {@link URIBuilder} instance for method chaining
    * @since 5.4
    */

Current Default -

Validation: ./mvnw -pl httpcore5 verify passed. All 1,380 tests passed, with no failures, errors, or skips.

@ok2c
ok2c merged commit 2ee2a73 into apache:master Sep 12, 2026
12 checks passed
@ok2c

ok2c commented Sep 12, 2026

Copy link
Copy Markdown
Member

Cherry-picked to 5.4.x

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