-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
fix: Don't alter the AST node positions of original code. #3800
Conversation
@Rawi01 Can you please review it. |
@Rawi01 can you please take a look. |
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.
Thanks for your contribution, great work!
- Please add yourself to the
AUTHORS
file visitAnnotation
inValidateNoDuplicateTreeNodeProcessor
is no longer necessary and can be removed
@@ -250,7 +250,7 @@ public JCMethodDecl createGetter(long access, JavacNode field, JavacTreeMaker tr | |||
|
|||
List<JCAnnotation> copyableAnnotations = findCopyableAnnotations(field); | |||
List<JCAnnotation> delegates = findDelegatesAndRemoveFromField(field); | |||
List<JCAnnotation> annsOnMethod = copyAnnotations(onMethod).appendList(copyableAnnotations); | |||
List<JCAnnotation> annsOnMethod = copyAnnotations(onMethod, field.getTreeMaker()).appendList(copyableAnnotations); |
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.
Nit:
List<JCAnnotation> annsOnMethod = copyAnnotations(onMethod, field.getTreeMaker()).appendList(copyableAnnotations); | |
List<JCAnnotation> annsOnMethod = copyAnnotations(onMethod, treeMaker).appendList(copyableAnnotations); |
hi @Rawi01 ; Thanks for the help getting this across the line! We're looking to leverage this downstream and I'm wondering what the release process looks like to get a local build. The instructions are 14 years old, so perhaps something has changed since? I know it's always a pain when folks ask when the next release will be, but any indication would also be appreciated. 🙏🏻 |
fixes: #3799
Changes:
Deep Copy for Annotations:
Testing
Added a unit test using Delombok to verify that AST node positions remain unchanged before and after the Lombok annotation processor is applied, across all existing test files.
Note: Without this change, 43 tests under test/transform/resource/before failed for the above unit test.