You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/12/29 06:24:28 UTC

[GitHub] [incubator-eventmesh] Alonexc opened a new issue, #2736: [Enhancement] Method builds a list from one element using Arrays.asList [SubscribeProcessor]

Alonexc opened a new issue, #2736:
URL: https://github.com/apache/incubator-eventmesh/issues/2736

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Enhancement Request
   
   ![image](https://user-images.githubusercontent.com/91315508/209911983-d238725a-a5bb-489c-9fe6-6fa0a6a39de3.png)
   located at:
   eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/http/processor/SubscribeProcessor.java line 222,239,249
   analysis and explanation:
   This method builds a list using Arrays.asList(foo), passing in a single element. Arrays.asList needs to first create an array from this one element, and then build a List that wraps this array. It is simpler to use Collections.singletonList(foo), which does not create the array, and produces a far simpler instance of List. Since both of these arrays are immutable (from the List's point of view) they are equivalent from a usage standpoint.
   
   
   ### Describe the solution you'd like
   
   It is simpler to use Collections.singletonList(foo).
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
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.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 closed issue #2736: [Enhancement] Method builds a list from one element using Arrays.asList [SubscribeProcessor]

Posted by GitBox <gi...@apache.org>.
xwm1992 closed issue #2736: [Enhancement] Method builds a list from one element using Arrays.asList [SubscribeProcessor]
URL: https://github.com/apache/incubator-eventmesh/issues/2736


-- 
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] jonyangx commented on issue #2736: [Enhancement] Method builds a list from one element using Arrays.asList [SubscribeProcessor]

Posted by GitBox <gi...@apache.org>.
jonyangx commented on issue #2736:
URL: https://github.com/apache/incubator-eventmesh/issues/2736#issuecomment-1368332612

   I want to fix it.


-- 
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