You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "mxsm (via GitHub)" <gi...@apache.org> on 2023/02/02 13:20:40 UTC

[GitHub] [incubator-eventmesh] mxsm opened a new pull request, #3024: [ISSUE #3020]Get String bytes by StandardCharsets.UTF_8

mxsm opened a new pull request, #3024:
URL: https://github.com/apache/incubator-eventmesh/pull/3024

   <!--
   ### Contribution Checklist
   
     - Name the pull request in the form "[ISSUE #XXXX] Title of the pull request", 
       where *XXXX* should be replaced by the actual issue number.
       Skip *[ISSUE #XXXX]* if there is no associated github issue for this pull request.
   
     - Fill out the template below to describe the changes contributed by the pull request. 
       That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue. 
       Please do not mix up code from multiple issues.
     
     - Each commit in the pull request should have a meaningful commit message.
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, 
       leaving only the filled out template below.
   
   (The sections below can be removed for hotfixes of typos)
   -->
   
   <!--
   (If this PR fixes a GitHub issue, please add `Fixes #<XXX>` or `Cloese #<XXX>`.)
   -->
   
   Fixes #3020 
   
   ### Motivation
   
   *Explain the content here.*
   *Explain why you want to make the changes and what problem you're trying to solve.*
   
   
   
   ### Modifications
   
   - Get String bytes by StandardCharsets.UTF_8
   
   
   ### Documentation
   
   - Does this pull request introduce a new feature? (yes / no)
   - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   - If a feature is not applicable for documentation, explain why?
   - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] mxsm commented on a diff in pull request #3024: [ISSUE #3020]Get String bytes by StandardCharsets.UTF_8

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #3024:
URL: https://github.com/apache/incubator-eventmesh/pull/3024#discussion_r1095245908


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/TopicHandler.java:
##########
@@ -85,8 +86,8 @@ void get(HttpExchange httpExchange) throws IOException {
         try {
             List<TopicProperties> topicList = admin.getTopic();
             String result = JsonUtils.toJson(topicList);
-            httpExchange.sendResponseHeaders(200, result.getBytes().length);
-            out.write(result.getBytes());
+            httpExchange.sendResponseHeaders(200, result.getBytes(StandardCharsets.UTF_8).length);

Review Comment:
   @mytang0  OK I will fix it and resubmit again



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] xwm1992 merged pull request #3024: [ISSUE #3020]Get String bytes by StandardCharsets.UTF_8

Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 merged PR #3024:
URL: https://github.com/apache/incubator-eventmesh/pull/3024


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] mxsm commented on a diff in pull request #3024: [ISSUE #3020]Get String bytes by StandardCharsets.UTF_8

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on code in PR #3024:
URL: https://github.com/apache/incubator-eventmesh/pull/3024#discussion_r1095245908


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/TopicHandler.java:
##########
@@ -85,8 +86,8 @@ void get(HttpExchange httpExchange) throws IOException {
         try {
             List<TopicProperties> topicList = admin.getTopic();
             String result = JsonUtils.toJson(topicList);
-            httpExchange.sendResponseHeaders(200, result.getBytes().length);
-            out.write(result.getBytes());
+            httpExchange.sendResponseHeaders(200, result.getBytes(StandardCharsets.UTF_8).length);

Review Comment:
   @mytang0  OK I will fix it, replace with Constants.DEFAULT_CHARSET and resubmit it later



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] mxsm commented on pull request #3024: [ISSUE #3020]Get String bytes by StandardCharsets.UTF_8

Posted by "mxsm (via GitHub)" <gi...@apache.org>.
mxsm commented on PR #3024:
URL: https://github.com/apache/incubator-eventmesh/pull/3024#issuecomment-1415844732

   @mytang0  PTAL~


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] codecov[bot] commented on pull request #3024: [ISSUE #3020]Get String bytes by StandardCharsets.UTF_8

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3024:
URL: https://github.com/apache/incubator-eventmesh/pull/3024#issuecomment-1416775046

   # [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/3024?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3024](https://codecov.io/gh/apache/incubator-eventmesh/pull/3024?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ee2fa52) into [master](https://codecov.io/gh/apache/incubator-eventmesh/commit/022f892204a1672f24cb5ae596a6f417fe57f433?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (022f892) will **increase** coverage by `0.00%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@            Coverage Diff            @@
   ##             master    #3024   +/-   ##
   =========================================
     Coverage     12.84%   12.84%           
     Complexity     1095     1095           
   =========================================
     Files           548      548           
     Lines         28623    28619    -4     
     Branches       2847     2835   -12     
   =========================================
     Hits           3676     3676           
   + Misses        24650    24648    -2     
   + Partials        297      295    -2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-eventmesh/pull/3024?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../eventmesh/runtime/admin/handler/TopicHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3024?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvVG9waWNIYW5kbGVyLmphdmE=) | `6.25% <0.00%> (ø)` | |
   | [...rg/apache/eventmesh/runtime/trace/LogExporter.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3024?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL3RyYWNlL0xvZ0V4cG9ydGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ime/admin/handler/RedirectClientByPathHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3024?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvUmVkaXJlY3RDbGllbnRCeVBhdGhIYW5kbGVyLmphdmE=) | `84.78% <0.00%> (ø)` | |
   | [...e/admin/handler/RedirectClientByIpPortHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3024?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvUmVkaXJlY3RDbGllbnRCeUlwUG9ydEhhbmRsZXIuamF2YQ==) | `31.37% <0.00%> (ø)` | |
   | [.../tcp/client/session/push/DownStreamMsgContext.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3024?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvcmUvcHJvdG9jb2wvdGNwL2NsaWVudC9zZXNzaW9uL3B1c2gvRG93blN0cmVhbU1zZ0NvbnRleHQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...l/tcp/client/recommend/EventMeshRecommendImpl.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/3024?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2NvcmUvcHJvdG9jb2wvdGNwL2NsaWVudC9yZWNvbW1lbmQvRXZlbnRNZXNoUmVjb21tZW5kSW1wbC5qYXZh) | `0.83% <0.00%> (+<0.01%)` | :arrow_up: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] mytang0 commented on a diff in pull request #3024: [ISSUE #3020]Get String bytes by StandardCharsets.UTF_8

Posted by "mytang0 (via GitHub)" <gi...@apache.org>.
mytang0 commented on code in PR #3024:
URL: https://github.com/apache/incubator-eventmesh/pull/3024#discussion_r1095205436


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/TopicHandler.java:
##########
@@ -85,8 +86,8 @@ void get(HttpExchange httpExchange) throws IOException {
         try {
             List<TopicProperties> topicList = admin.getTopic();
             String result = JsonUtils.toJson(topicList);
-            httpExchange.sendResponseHeaders(200, result.getBytes().length);
-            out.write(result.getBytes());
+            httpExchange.sendResponseHeaders(200, result.getBytes(StandardCharsets.UTF_8).length);

Review Comment:
   I remember that the public module should have the definition of charsets, which you can use directly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org