eventmesh
eventmesh copied to clipboard
[ISSUE #3855] General code simplification
Fixes #3855.
Motivation
see "Enhancement Request" in issue related.
Modifications
see "Describe the solution you'd like" in issue related.
Documentation
- Does this pull request introduce a new feature? no
Hi @pandaapo IMO, If you overuse the static import feature, it makes the program unreadable and unmaintainable.
Thanks for your review. It is indeed controversial about import static's advantage and disadvantage.
In consideration of "use it when you require frequent access to static members from one or two classes" in Guidance, should I revoke all of them? Or revoke some except for the follows(>= 3 times access to static members of a class)? https://github.com/apache/eventmesh/blob/21f0bb9eba43220e5148f1d5add8ac12bc212861/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/HttpCommand.java#L22-L24 https://github.com/apache/eventmesh/blob/21f0bb9eba43220e5148f1d5add8ac12bc212861/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/HttpEventWrapper.java#L23-L35 https://github.com/apache/eventmesh/blob/21f0bb9eba43220e5148f1d5add8ac12bc212861/eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/http/HttpEventWrapper.java#L38-L40
In addition, I think it will be better if community can specify when to use import static as part of code conduct.
Codecov Report
Merging #3856 (8abfaed) into master (3f49cd4) will decrease coverage by
3.00%. The diff coverage is30.30%.
:exclamation: Current head 8abfaed differs from pull request most recent head e1ca83c. Consider uploading reports for the commit e1ca83c to get more accurate results
@@ Coverage Diff @@
## master #3856 +/- ##
============================================
- Coverage 16.91% 13.92% -3.00%
+ Complexity 1410 1291 -119
============================================
Files 588 570 -18
Lines 25743 28806 +3063
Branches 2376 2806 +430
============================================
- Hits 4355 4011 -344
- Misses 20954 24422 +3468
+ Partials 434 373 -61
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...org/apache/eventmesh/common/ThreadPoolFactory.java | 16.66% <ø> (ø) |
|
| ...mmon/protocol/grpc/common/BatchMessageWrapper.java | 0.00% <0.00%> (ø) |
|
| ...mon/protocol/grpc/common/SimpleMessageWrapper.java | 0.00% <0.00%> (ø) |
|
| ...entmesh/common/protocol/http/HttpEventWrapper.java | 0.00% <0.00%> (ø) |
|
| .../apache/eventmesh/common/protocol/tcp/Package.java | 75.00% <60.00%> (+1.66%) |
:arrow_up: |
| ...he/eventmesh/common/protocol/http/HttpCommand.java | 66.25% <84.21%> (+7.62%) |
:arrow_up: |
| ...pache/eventmesh/common/EventMeshThreadFactory.java | 61.11% <100.00%> (-8.46%) |
:arrow_down: |
... and 231 files with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
@pandaapo please fix the conflicts.
@pandaapo please fix the conflicts.
OK.
But 1 question:
What do you think about this review that I was waiting for replying? Should I revoke all of import static? Or revoke a portion except for accessing 3 or more static members of a type? CC @mxsm
revoke a portion except for accessing 3 or more static members of a type
IMO, revoke a portion except for accessing 3 or more static members of a type is better. @pandaapo
It has been 60 days since the last activity on this pull request. I am reaching out here to gently remind you that the Apache EventMesh community values every pull request, and please feel free to get in touch with the reviewers at any time. They are available to assist you in advancing the progress of your pull request and offering the latest feedback.
If you encounter any challenges during development, seeking support within the community is encouraged. We sincerely appreciate your contributions to Apache EventMesh.
Codecov Report
Attention: Patch coverage is 30.30303% with 46 lines in your changes missing coverage. Please review.
Project coverage is 13.92%. Comparing base (
3f49cd4) to head (8abfaed). Report is 506 commits behind head on master.
:exclamation: Current head 8abfaed differs from pull request most recent head e1ca83c
Please upload reports for the commit e1ca83c to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@
## master #3856 +/- ##
============================================
- Coverage 16.91% 13.92% -3.00%
+ Complexity 1410 1291 -119
============================================
Files 588 570 -18
Lines 25743 28806 +3063
Branches 2376 2806 +430
============================================
- Hits 4355 4011 -344
- Misses 20954 24422 +3468
+ Partials 434 373 -61
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I agree with "use it when you require frequent access to static members from one or two classes". The class name of a static import member is helpful to indicate the use of the member.
Please resolve conflicts~
It has been 60 days since the last activity on this pull request. I am reaching out here to gently remind you that the Apache EventMesh community values every pull request, and please feel free to get in touch with the reviewers at any time. They are available to assist you in advancing the progress of your pull request and offering the latest feedback.
If you encounter any challenges during development, seeking support within the community is encouraged. We sincerely appreciate your contributions to Apache EventMesh.
It has been 60 days since the last activity on this pull request. I am reaching out here to gently remind you that the Apache EventMesh community values every pull request, and please feel free to get in touch with the reviewers at any time. They are available to assist you in advancing the progress of your pull request and offering the latest feedback.
If you encounter any challenges during development, seeking support within the community is encouraged. We sincerely appreciate your contributions to Apache EventMesh.