-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce java.nio.charset.StandardCharsets against guava Charsets #32083
Conversation
@@ -119,6 +119,14 @@ page at http://checkstyle.sourceforge.net/config.html --> | |||
<property name="message" value="You are using raw guava, please use vendored guava classes."/> | |||
</module> | |||
|
|||
<!-- Forbid guava Charset. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested that the enforcement is effective
without source code changes, build fails with
> Task :sdks:java:core:checkstyleMain
[ant:checkstyle] [ERROR] /Users/yathu/beam/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms/providers/LoggingTransformProvider.java:39: You are using guava Charsets, please use Java builtin StandardCharsets. [ForbidGuavaCharset]
...
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
testInvalidRecordReceived (org.apache.beam.sdk.io.gcp.spanner.changestreams.SpannerChangeStreamErrorTest) failed unrelated flaky test. It passed on the first commit of this PR |
assign set of reviewers |
Assigning reviewers. If you would like to opt out of this review, comment R: @robertwb for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
This has been causing internal check violation (ref: go/standardcharsets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
StandardCharsets is introduced in JRE 7, and guava Charset is now a delegate to java.nio Charsets, e.g.
https://github.com/google/guava/blob/8bab177c14b6c3faf82d6959a9c774b0d15e7414/guava/src/com/google/common/base/Charsets.java#L67
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.