Skip to content
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

Constant charset String literal (for example, "UTF-8") can be replaced with the predefined StandardCharsets.UTF_8 code. #290

Merged

Conversation

arturobernalg
Copy link
Member

The code after the fix may work faster, because the charset lookup becomes unnecessary. Also, catching UnsupportedEncodingException may become unnecessary as well. In this case, the catch block will be removed automatically.

…d with the predefined StandardCharsets.UTF_8 code.

The code after the fix may work faster, because the charset lookup becomes unnecessary. Also, catching UnsupportedEncodingException may become unnecessary as well. In this case, the catch block will be removed automatically.
Copy link
Contributor

@juanpablo-santos juanpablo-santos left a comment

Choose a reason for hiding this comment

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

lgtm

@juanpablo-santos juanpablo-santos merged commit f364625 into apache:master Jul 29, 2023
1 check passed
@juanpablo-santos
Copy link
Contributor

merged in 2.12.1-git-02, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants