Skip to content

GH-3901: Use StandardCharsets and Objects instead of legacy helpers - #3907

Merged
Fokko merged 1 commit into
apache:masterfrom
Fokko:jdk17-common-helpers-cleanup
Oct 29, 2026
Merged

Fokko merged 1 commit into
apache:masterfrom
Fokko:jdk17-common-helpers-cleanup

Conversation

@Fokko

@Fokko Fokko commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

A few places still used Charset.forName("UTF-8") or the deprecated Preconditions.checkNotNull.

What changes are included in this PR?

  • BytesUtils.UTF8 and PlainValuesWriter.CHARSET are now StandardCharsets.UTF_8, and PlainValuesWriter.CHARSET gets a @deprecated pointer to it.
  • Tests use StandardCharsets.UTF_8 instead of "UTF-8" strings.
  • SnappyUtil uses Objects.requireNonNull.

Are these changes tested?

Covered by the existing tests.

Are there any user-facing changes?

No. The constants keep their type and value.

Closes #3901

This pull request and its description were written by Isaac.

…pers

Point the deprecated BytesUtils.UTF8 and PlainValuesWriter.CHARSET
constants at StandardCharsets.UTF_8 and document the replacement.
Replace "UTF-8" charset lookups in tests with StandardCharsets.UTF_8,
and use Objects.requireNonNull in SnappyUtil instead of the deprecated
Preconditions.checkNotNull.

Co-authored-by: Isaac <[email protected]>
@Fokko
Fokko requested a review from wgtmac October 28, 2026 23:10
@Fokko
Fokko merged commit 4cac763 into apache:master Oct 29, 2026
5 checks passed
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.

Use StandardCharsets and Objects instead of legacy helpers

2 participants