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

   ### 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://github.com/apache/eventmesh/assets/91315508/4f0eeda5-815e-4f42-9f52-79537d9a3b04)
   
![image](https://github.com/apache/eventmesh/assets/91315508/d0253336-9615-4a17-9cc3-c8acb251550c)
   
![image](https://github.com/apache/eventmesh/assets/91315508/4f935fe2-d64e-47f1-83e8-f6c8bcab3a67)
   
![image](https://github.com/apache/eventmesh/assets/91315508/81e3cc68-f090-4b4d-8b3b-e5ae712041c1)
   located at:
   
eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/common/EventMeshCloudEventUtils.java
   analysis and explanation:
   1. Repeated code operations can be accomplished using a single method.
   2. Passing a non-null argument to 'Optional'.[366,383]
   3. Condition 'protoData == null' and 'binaryData == null' is always 
'false'.[370,374]
   4. 'return' is unnecessary as the last statement in a 'void' method[416]
   
   
   ### Describe the solution you'd like
   
   1. Extract as a method.
   
![image](https://github.com/apache/eventmesh/assets/91315508/d021629a-33f0-4e0f-9fe4-a524e0e33729)
   2. Replace with 'Optional.of()'
   
![image](https://github.com/apache/eventmesh/assets/91315508/ae3dd5ad-68eb-4def-8323-f09ecfe8e2c3)
   3. Remove
   
![image](https://github.com/apache/eventmesh/assets/91315508/a3b7d3f5-9ec1-47de-bae2-931f8eaa8943)
   4. Remove unnecessary `return`.
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to