-
Notifications
You must be signed in to change notification settings - Fork 639
[ISSUE #4262] Enhancement Request EventMeshCloudEventUtils #4337
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to the Apache EventMesh community!!
This is your first PR in our project. We're very excited to have you onboard contributing. Your contributions are greatly appreciated!
Please make sure that the changes are covered by tests.
We will be here shortly.
Let us know if you need any help!
Want to get closer to the community?
| WeChat Assistant | WeChat Public Account | Slack |
|---|---|---|
![]() |
![]() |
Join Slack Chat |
Mailing Lists:
| Name | Description | Subscribe | Unsubscribe | Archive |
|---|---|---|---|---|
| Users | User support and questions mailing list | Subscribe | Unsubscribe | Mail Archives |
| Development | Development related discussions | Subscribe | Unsubscribe | Mail Archives |
| Commits | All commits to repositories | Subscribe | Unsubscribe | Mail Archives |
| Issues | Issues or PRs comments and reviews | Subscribe | Unsubscribe | Mail Archives |
Codecov Report
@@ Coverage Diff @@
## master #4337 +/- ##
============================================
- Coverage 16.35% 16.18% -0.17%
- Complexity 1362 1363 +1
============================================
Files 594 594
Lines 25393 25343 -50
Branches 2393 2391 -2
============================================
- Hits 4152 4103 -49
+ Misses 20818 20815 -3
- Partials 423 425 +2
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
mxsm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pil0tXia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to EventMesh community.
...src/main/java/org/apache/eventmesh/common/protocol/grpc/common/EventMeshCloudEventUtils.java
Show resolved
Hide resolved
Pil0tXia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
...src/main/java/org/apache/eventmesh/common/protocol/grpc/common/EventMeshCloudEventUtils.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/eventmesh/common/protocol/grpc/common/EventMeshCloudEventUtils.java
Outdated
Show resolved
Hide resolved
…ant else for Optional.of
…che#4337) * issue-4262 Enhancement Request EventMeshCloudEventUtils * issue-4262 Enhancement Request EventMeshCloudEventUtils move on top method getValue * issue-4262 Enhancement Request EventMeshCloudEventUtils remove redundant else for Optional.of --------- Co-authored-by: maxim.zgardan <maxim.zgardan@accenture.com>


Fixes #4262.
Motivation
Modifications
located at:
eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/grpc/common/EventMeshCloudEventUtils.java
1.Extract
as a method private static String getValue(CloudEvent cloudEvent, String defaultValue, String protocolKey) .
2.Replace Optional.ofNullable() with 'Optional.of()' - Passing a non-null argument to 'Optional'.[366,383]
3.Remove Condition 'protoData == null' and 'binaryData == null' is always 'false'.[370,374]
4.Remove unnecessary return as the last statement in a 'void' method[416].
Documentation