Skip to content
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

Standardize @Retention usage in Lombok annotationsfix: Standardize @Retention usage in annotations #3678

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xpmxf4
Copy link

@xpmxf4 xpmxf4 commented May 29, 2024

Description

This pull request standardizes the usage of the @retention annotation across Lombok's annotations. Specifically, it changes the usage in the @builder annotation from @Retention(SOURCE) to @Retention(RetentionPolicy.SOURCE).

Reason for Change

The other annotations in the Lombok project, such as @getter and @Setter, use @Retention(RetentionPolicy.SOURCE). For the sake of consistency and readability, this change ensures that all annotations follow the same convention.

Changes Made

  • Updated @Retention(SOURCE) to @Retention(RetentionPolicy.SOURCE) in the @builder annotation.

Impact

This change does not affect the functionality of the annotations but improves the consistency and maintainability of the codebase.

Verification

No additional tests are needed as this change only affects the annotation declaration style.

Please review and let me know if there are any concerns or further changes needed.

Thank you!

- Changed @retention(SOURCE) to @retention(RetentionPolicy.SOURCE) in @builder to ensure consistency across all annotations.
@rzwitserloot
Copy link
Collaborator

There's a @Target annotation immediately above that also isn't consistent.

This isn't a meaningful update unless:

  • You go the other way - Builder is right ,Setter is wrong: You want the static imports and the @RetentionPolicy(SOURCE), you've moved us to a more consistent, but less desired place. The PR should update Getter, Setter etc instead.
  • It needs to cover all the annotations. So, also @Target, which also needs to move to a 'use star-static imports' mode.

NB: Stylistically it's star imports, because annotations predetermine what the values can be; The RetentionPolicy. adds nothing useful.

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.

2 participants