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

[GitHub] [eventmesh] kyooosukedn opened a new pull request, #3786: [ISSUE #3480] Anonymous new TextMapSetter>() can be replaced with lambda

kyooosukedn opened a new pull request, #3786:
URL: https://github.com/apache/eventmesh/pull/3786

   <!--
   ### 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 `Closes #<XXX>`.)
   -->
   
   Fixes #3480 .
   
   ### Motivation
   
   *Anonymous new TextMapSetter<Map<String, Object>>() can be replaced with lambda*
   *Improve source code's readability.*
   
   
   
   ### Modifications
   *Replaced Anonymous new TextMapSetter<Map<String, Object>>() with lambda.*
   
   
   
   ### Documentation
   
   - Does this pull request introduce a new feature? (no)
   - If yes, how is the feature documented? (not applicable)
   
   


-- 
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] [eventmesh] codecov[bot] commented on pull request #3786: [ISSUE #3480] Anonymous new TextMapSetter>() can be replaced with lambda

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

   ## [Codecov](https://app.codecov.io/gh/apache/eventmesh/pull/3786?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 [#3786](https://app.codecov.io/gh/apache/eventmesh/pull/3786?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (feff5a2) into [master](https://app.codecov.io/gh/apache/eventmesh/commit/228cc82a041d8de747efc2a398f6a0d78799728b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (228cc82) will **decrease** coverage by `0.86%`.
   > The diff coverage is `6.66%`.
   
   > :exclamation: Current head feff5a2 differs from pull request most recent head a8be569. Consider uploading reports for the commit a8be569 to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3786      +/-   ##
   ============================================
   - Coverage     14.62%   13.77%   -0.86%     
   + Complexity     1526     1291     -235     
   ============================================
     Files           651      571      -80     
     Lines         31713    29130    -2583     
     Branches       3032     2848     -184     
   ============================================
   - Hits           4638     4012     -626     
   + Misses        26659    24744    -1915     
   + Partials        416      374      -42     
   ```
   
   
   | [Impacted Files](https://app.codecov.io/gh/apache/eventmesh/pull/3786?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...in/java/org/apache/eventmesh/common/Constants.java](https://app.codecov.io/gh/apache/eventmesh/pull/3786?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2NvbW1vbi9Db25zdGFudHMuamF2YQ==) | `85.71% <ø> (ø)` | |
   | [.../apache/eventmesh/common/config/ConfigService.java](https://app.codecov.io/gh/apache/eventmesh/pull/3786?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2NvbW1vbi9jb25maWcvQ29uZmlnU2VydmljZS5qYXZh) | `45.00% <0.00%> (+0.55%)` | :arrow_up: |
   | [.../eventmesh/common/enums/EventMeshProtocolType.java](https://app.codecov.io/gh/apache/eventmesh/pull/3786?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2NvbW1vbi9lbnVtcy9FdmVudE1lc2hQcm90b2NvbFR5cGUuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...ventmesh/common/protocol/tcp/EventMeshMessage.java](https://app.codecov.io/gh/apache/eventmesh/pull/3786?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2NvbW1vbi9wcm90b2NvbC90Y3AvRXZlbnRNZXNoTWVzc2FnZS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...rotocol/workflow/protos/EventmeshWorkflowGrpc.java](https://app.codecov.io/gh/apache/eventmesh/pull/3786?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2NvbW1vbi9wcm90b2NvbC93b3JrZmxvdy9wcm90b3MvRXZlbnRtZXNoV29ya2Zsb3dHcnBjLmphdmE=) | `0.00% <ø> (ø)` | |
   | [.../org/apache/eventmesh/common/EventMeshMessage.java](https://app.codecov.io/gh/apache/eventmesh/pull/3786?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2NvbW1vbi9FdmVudE1lc2hNZXNzYWdlLmphdmE=) | `35.29% <100.00%> (+3.71%)` | :arrow_up: |
   
   ... and [279 files with indirect coverage changes](https://app.codecov.io/gh/apache/eventmesh/pull/3786/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] xwm1992 merged pull request #3786: [ISSUE #3480] Anonymous new TextMapSetter>() can be replaced with lambda

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


-- 
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] [eventmesh] pandaapo commented on a diff in pull request #3786: [ISSUE #3480] Anonymous new TextMapSetter>() can be replaced with lambda

Posted by "pandaapo (via GitHub)" <gi...@apache.org>.
pandaapo commented on code in PR #3786:
URL: https://github.com/apache/eventmesh/pull/3786#discussion_r1173673710


##########
eventmesh-trace-plugin/eventmesh-trace-zipkin/src/main/java/org/apache/eventmesh/trace/zipkin/ZipkinTraceService.java:
##########
@@ -144,12 +144,7 @@ public String get(Map<String, Object> carrier, String key) {
 
     @Override
     public void inject(Context context, Map<String, Object> map) {
-        textMapPropagator.inject(context, map, new TextMapSetter<Map<String, Object>>() {
-            @Override
-            public void set(@Nullable Map<String, Object> carrier, String key, String value) {
-                map.put(key, value);
-            }
-        });
+        textMapPropagator.inject(context, map, (carrier, key, value) -> map.put(key, value));

Review Comment:
   It seems that the variable `map` in lambda should be `carrier`.



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] Alonexc commented on pull request #3786: [ISSUE #3480] Anonymous new TextMapSetter>() can be replaced with lambda

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

   ![image](https://user-images.githubusercontent.com/91315508/234750022-89b54ccd-bc2d-44d6-9eb6-5a3bb6c6fa03.png)
   `@Nonnull` Missing import.


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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


[GitHub] [eventmesh] kyooosukedn commented on a diff in pull request #3786: [ISSUE #3480] Anonymous new TextMapSetter>() can be replaced with lambda

Posted by "kyooosukedn (via GitHub)" <gi...@apache.org>.
kyooosukedn commented on code in PR #3786:
URL: https://github.com/apache/eventmesh/pull/3786#discussion_r1174459717


##########
eventmesh-trace-plugin/eventmesh-trace-zipkin/src/main/java/org/apache/eventmesh/trace/zipkin/ZipkinTraceService.java:
##########
@@ -144,12 +144,7 @@ public String get(Map<String, Object> carrier, String key) {
 
     @Override
     public void inject(Context context, Map<String, Object> map) {
-        textMapPropagator.inject(context, map, new TextMapSetter<Map<String, Object>>() {
-            @Override
-            public void set(@Nullable Map<String, Object> carrier, String key, String value) {
-                map.put(key, value);
-            }
-        });
+        textMapPropagator.inject(context, map, (carrier, key, value) -> map.put(key, value));

Review Comment:
   Thanks for your feedback



-- 
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: issues-unsubscribe@eventmesh.apache.org

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


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