Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Some optimizations to GrpcEventMeshCloudEventProtocolResolver. #4267

Closed
1 of 2 tasks
Alonexc opened this issue Jul 21, 2023 · 2 comments · Fixed by #4279
Closed
1 of 2 tasks

[Enhancement] Some optimizations to GrpcEventMeshCloudEventProtocolResolver. #4267

Alonexc opened this issue Jul 21, 2023 · 2 comments · Fixed by #4279
Assignees
Labels
enhancement New feature or request good first issue Issues for first-time contributors

Comments

@Alonexc
Copy link
Contributor

Alonexc commented Jul 21, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

Enhancement Request

image
image
located at:
eventmesh-protocol-plugin/eventmesh-protocol-cloudevents/src/main/java/org/apache/eventmesh/protocol/cloudevents/resolver/grpc/GrpcEventMeshCloudEventProtocolResolver.java line 43,51,60
analysis and explanation:
a. Immediately return this expression instead of assigning it to the temporary variable "event".
b. Method invocation 'deserialize' may produce 'NullPointerException'

Describe the solution you'd like

Inline variable and use Objects.requireNonNull()
image
image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@Alonexc Alonexc added the enhancement New feature or request label Jul 21, 2023
@mxsm mxsm added the good first issue Issues for first-time contributors label Jul 21, 2023
@devCod3r
Copy link
Contributor

Hello, I would like to work on this. Please assign this issue to my name. Thank you!!

@Alonexc
Copy link
Contributor Author

Alonexc commented Jul 21, 2023

@devCod3r ok! You can submit the pr first.

mxsm pushed a commit that referenced this issue Jul 25, 2023
)

* [ISSUE #4269] Used switch to replace the if-else. [MeshMessageProtocolAdaptor]

* [ISSUE #4269] Used switch to replace the if-else. [MeshMessageProtocolAdaptor]

* [ISSUE #4269] Used switch to replace the if-else. [MeshMessageProtocolAdaptor]

* [ISSUE #4269] Used switch to replace the if-else. [MeshMessageProtocolAdaptor]

* [ISSUE #4267] Optimized [GrpcEventMeshCloudEventProtocolResolver]

* [ISSUE #4267] Optimized [GrpcEventMeshCloudEventProtocolResolver]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Issues for first-time contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants