Add deprecated method warn when called by user
What is the purpose of the change
Add deprecated method warn when called by user , related with #10850
Brief changelog
Verifying this change
Checklist
- [x] Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
- [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
- [ ] Add some description to dubbo-website project if you are requesting to add a feature.
- [ ] GitHub Actions works fine on your own branch.
- [ ] If this contribution is large, please follow the Software Donation Guide.
As for https://github.com/apache/dubbo/issues/10850, we want to check all of the methods annotated with @Deprecated.
I have several doubts when I am looking for an abandoned method
-
How to find abandoned methods? At present, I am looking for all methods that have added @ Deprecated annotation. I find that there are a lot of data that meet the conditions. Is there a better way?
-
For methods with @ Deprecated, do you need to add logs? If the class is abandoned, do you need to add logs for all methods of the class. For abstract class, final class, and tool class, do you need to add warn logs? For some abandoned get/set methods, do you need to add warn logs?
I have several doubts when I am looking for an abandoned method
- How to find abandoned methods? At present, I am looking for all methods that have added @ Deprecated annotation. I find that there are a lot of data that meet the conditions. Is there a better way?
- For methods with @ Deprecated, do you need to add logs? If the class is abandoned, do you need to add logs for all methods of the class. For abstract class, final class, and tool class, do you need to add warn logs? For some abandoned get/set methods, do you need to add warn logs?
Is it possible to generate some code when compiling to achieve this?