-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
Add Dubbo Annotation Processor (Add deprecated method warn when called by user, #10850) #11513
Conversation
Related dubbo-website PR: apache/dubbo-website#2140 |
@AlbumenJ PTAL. |
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.
Please rebase your branch onto 3.2
...nnotation-processor/src/main/java/org/apache/dubbo/annotation/handler/DeprecatedHandler.java
Outdated
Show resolved
Hide resolved
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.
Can the inserted code also inserted into xxx-source.jar
?
5f9e9c9
to
3992369
Compare
Rebased.
Moved all the logic to
Unfortunately, it can't. It works as a compiler addon (an annotation processor). It directly modifies the Abstract Syntax Tree (i.e. the |
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.
@chickenlj PTAL
8da9c6e
to
5c75a87
Compare
…etailed logic directly.
28c97e0
to
5a8653c
Compare
@AlbumenJ PTAL. The scope configuration of pom.xml is required to import javac package (tools.jar), which causes 'bugs' in SonarLint. |
dubbo-annotation-processor/src/main/java/org/apache/dubbo/annotation/permit/Permit.java
Outdated
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! |
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
…en called by user, apache#10850) (apache#11513)" This reverts commit 0b6f2e4.
What is the purpose of the change
Trying to provide a solution of #10850.
Brief changelog
Adds an annotation processor, which adds a line of code in every methods decorated by
@Deprecated
. Like getServiceName() in class URL of dubbo-common module (decompiled result):Per suggestion from Albumen Kevin, the count of the deprecated method invocation is also recorded.
Verifying this change
Use a decomplier (like Java Decompiler, or FernFlower decompiler in IntelliJ IDEA) to see the result.