Alonexc opened a new issue, #4261: URL: https://github.com/apache/eventmesh/issues/4261
### 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       located at: eventmesh-sdks/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/util/EventMeshCloudEventBuilder.java analysis and explanation: 1. Local variable 'eventMeshMessage' and 'cloudEvent' is redundant.[145,194] 2. Remove the parentheses around the "key" parameter[151] 3. Can be replaced with 'Map.forEach()'.[164] 4. Repeated code operations can be accomplished using a single method.[195-242] 5. Unchecked cast: 'java.util.Set<java.util.HashMap<java.lang.String,java.lang.String>>' to 'T' ### Describe the solution you'd like 1. Inline variable 2. Remove the parentheses around the "key" parameter 3. Replaced with 'Map.forEach()'.  4. Extract as a method. Constants.EVENTMESH_MESSAGE_CONST_TTL is the same as ProtocolKey.TTL.   5. Add `@SuppressWarnings("unchecked")` to this method.  ### 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]
