docs(extension): Fix comments for ActivateComparator and WrapperCompa… - #15651
docs(extension): Fix comments for ActivateComparator and WrapperCompa…#15651lokidundun wants to merge 1 commit into
Conversation
…rator docs(extension): Fix comments for ActivateComparator and WrapperComparator Optimize the class comments of `ActivateComparator` and `WrapperComparator`: 1. Correct the wrong class name reference in the original comment of `WrapperComparator` (e.g., the old comment might mislead to `OrderComparator`). 2. Supplement clear functional descriptions to help other developers understand the role of these two comparators. 3. Ensure code documentation is consistent with actual logic, improving the readability and maintainability of the Dubbo project. - [ ] Make sure there is a [GitHub issue](https://github.com/apache/dubbo/issues) field for the change. This change is a documentation-level optimization for code comments and is not associated with a specific Issue. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project. This change only involves comment optimization without logical changes, so unit tests are not required. - [x] Make sure GitHub actions can pass. [Why the workflow is failing and how to fix it?](./CONTRIBUTING.md)
|
Hi @zrlw, This PR optimizes Javadoc comments for Would appreciate your review when you have time! Best regards, |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.3 #15651 +/- ##
============================================
- Coverage 61.01% 61.01% -0.01%
+ Complexity 11704 11701 -3
============================================
Files 1910 1910
Lines 86806 86806
Branches 13100 13100
============================================
- Hits 52968 52963 -5
Misses 28419 28419
- Partials 5419 5424 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes incorrect class name references in JavaDoc comments for two comparator classes. The comments previously referenced "OrderComparator" instead of the actual class names.
- Corrected the class name reference in
ActivateComparatorJavaDoc from "OrderComparator" to "ActivateComparator" - Corrected the class name reference in
WrapperComparatorJavaDoc from "OrderComparator" to "WrapperComparator"
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ActivateComparator.java | Fixed JavaDoc comment to reference correct class name |
| WrapperComparator.java | Fixed JavaDoc comment to reference correct class name |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| /** | ||
| * OrderComparator | ||
| * ActivateComparator |
There was a problem hiding this comment.
The JavaDoc comment should include a brief description of what the ActivateComparator does, not just the class name. Consider adding a sentence explaining its purpose in the Dubbo extension system.
| * ActivateComparator | |
| * A comparator for ordering Dubbo extension classes annotated with {@link org.apache.dubbo.common.extension.Activate}. | |
| * <p> | |
| * This comparator determines the activation order of extensions based on their {@code order}, {@code before}, and {@code after} | |
| * attributes in the Dubbo extension system. It is used to ensure that extensions are activated in the correct sequence | |
| * according to their dependencies and priorities. |
| /** | ||
| * OrderComparator | ||
| * WrapperComparator | ||
| * Derived from {@link ActivateComparator} |
There was a problem hiding this comment.
The JavaDoc comment should include a brief description of what the WrapperComparator does, not just the class name. Consider adding a sentence explaining its purpose and how it differs from or relates to the ActivateComparator it derives from.
| * Derived from {@link ActivateComparator} | |
| * A comparator for ordering wrapper extension classes based on their {@code @Activate} or {@code @Wrapper} annotation order values. | |
| * <p> | |
| * This comparator is similar to {@link ActivateComparator}, but is specifically used for wrapper classes that may be annotated with {@code @Wrapper}. | |
| * It ensures that wrappers are sorted according to their specified order, supporting both legacy and new annotation styles. |
|
As AI tools could generate more accurate documentations, e.g., copilot, tiny document defects might remain unresolved for the time being, |
|
How about just deleting all those comments that only contain the class name? I’m already fed up with similar issues. These comments are not helpful at all and only keep causing problems. |
…rator
Optimize the class comments of
ActivateComparatorandWrapperComparator:WrapperComparator(e.g., the old comment might mislead toOrderComparator).Make sure there is a GitHub issue field for the change.
This change is a documentation-level optimization for code comments and is not associated with a specific Issue.
Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
This change only involves comment optimization without logical changes, so unit tests are not required.
Make sure GitHub actions can pass. Why the workflow is failing and how to fix it?
What is the purpose of the change?
Checklist