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

[Enhancement] This method should use a StandardCharsets.XXX.name() to specify an encoding [NacosWebHookConfigOperation] #2244

Closed
1 of 2 tasks
Alonexc opened this issue Nov 23, 2022 · 0 comments · Fixed by #2263
Labels
enhancement New feature or request good first issue Issues for first-time contributors

Comments

@Alonexc
Copy link
Contributor

Alonexc commented Nov 23, 2022

Search before asking

  • I had searched in the issues and found no similar issues.

Enhancement Request

image
located at:
org/apache/eventmesh/webhook/admin/NacosWebHookConfigOperation.java line 187
analysis and explanation:
This method uses a hand-typed String literal to specify a Charset encoding. As this class is compiled with JDK 7 (or better), and the charset in question is available as a constant from the java.nio.charset.StandardCharsets class, it is better to use the .name() method of the appropriate StandardCharsets constant.
The method in question doesn't directly support a Charset as a parameter, only a String. Still, instead of specifying something like "UTF-8" (and potentially mistyping it), use StandardCharsets.UTF_8.name().

Describe the solution you'd like

Change to use StandardCharsets.UTF_8.name().

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@Alonexc Alonexc added the enhancement New feature or request label Nov 23, 2022
@xwm1992 xwm1992 added the good first issue Issues for first-time contributors label Nov 25, 2022
LIU-WEI-git pushed a commit that referenced this issue Nov 27, 2022
* Update constants

* Update constants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Issues for first-time contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants