Skip to content

docs(extension): Fix comments for ActivateComparator and WrapperCompa… - #15651

Closed
lokidundun wants to merge 1 commit into
apache:3.3from
lokidundun:3.3
Closed

docs(extension): Fix comments for ActivateComparator and WrapperCompa…#15651
lokidundun wants to merge 1 commit into
apache:3.3from
lokidundun:3.3

Conversation

@lokidundun

Copy link
Copy Markdown

…rator
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 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

  • Make sure there is a GitHub_issue field for the change.
  • 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.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

…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)
@lokidundun

Copy link
Copy Markdown
Author

Hi @zrlw,

This PR optimizes Javadoc comments for ActivateComparator and WrapperComparator — fixing wrong class references (e.g., OrderComparator mixup) and adding clearer functional descriptions. All content is in English, and CI checks are running.

Would appreciate your review when you have time!

Best regards,
lokidundun

@codecov-commenter

codecov-commenter commented Aug 22, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.01%. Comparing base (c831fef) to head (dc4f7a6).
⚠️ Report is 1 commits behind head on 3.3.

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     
Flag Coverage Δ
integration-tests-java21 32.95% <ø> (-0.07%) ⬇️
integration-tests-java8 33.11% <ø> (-0.01%) ⬇️
samples-tests-java21 32.70% <ø> (+0.01%) ⬆️
samples-tests-java8 30.44% <ø> (+0.02%) ⬆️
unit-tests-java11 59.03% <ø> (+0.02%) ⬆️
unit-tests-java17 58.71% <ø> (-0.02%) ⬇️
unit-tests-java21 58.71% <ø> (-0.01%) ⬇️
unit-tests-java8 59.02% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zrlw
zrlw requested review from Copilot August 22, 2025 06:27

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ActivateComparator JavaDoc from "OrderComparator" to "ActivateComparator"
  • Corrected the class name reference in WrapperComparator JavaDoc 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

Copilot AI Aug 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
* 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.

Copilot uses AI. Check for mistakes.
/**
* OrderComparator
* WrapperComparator
* Derived from {@link ActivateComparator}

Copilot AI Aug 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
* 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.

Copilot uses AI. Check for mistakes.
@zrlw

zrlw commented Aug 22, 2025

Copy link
Copy Markdown
Contributor

As AI tools could generate more accurate documentations, e.g., copilot, tiny document defects might remain unresolved for the time being,

@zrlw zrlw closed this Aug 22, 2025
@RainYuY

RainYuY commented Aug 22, 2025

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants