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

[FEATURE] Support jsr305 @Nonnegative and @RegEx #3498

Open
magicprinc opened this issue Sep 12, 2023 · 1 comment
Open

[FEATURE] Support jsr305 @Nonnegative and @RegEx #3498

magicprinc opened this issue Sep 12, 2023 · 1 comment

Comments

@magicprinc
Copy link

magicprinc commented Sep 12, 2023

Dear Project Lombok maintainers,

I am writing to request the addition of support for famous JSR-305 annotations,
specifically @Nonnegative and @RegEx.

The JSR-305 annotations are widely accepted and used by many developers due to their robust null-safety capabilities. They provide significant benefits such as better readability, more informative error messages, and reduced code complexity dzone.com.

The @Nonnegative annotation can help enforce that a numerical value should never be negative, while the @RegEx annotation can be used to document that a particular method or field should represent a regular expression. These annotations can help prevent bugs related to incorrect values and improve code quality.

Current configuration options in Lombok include the capability to add nullability annotations, such as @nonnull, to methods and constructors baeldung.com. However, the lack of support for @Nonnegative and @RegEx in Lombok means that developers have to manually check conditions in their code, which can be tedious and error-prone.

It's important to note that other frameworks, such as Spring Boot, have started supporting JSR-305 annotations, which demonstrates their growing adoption in the Java community github.com.

Adding support for @Nonnegative and @RegEx in Lombok would not only increase the library's functionality but also align it with the evolving best practices in Java development.

I understand that adding new features requires careful consideration and effort, but I believe that the benefits to the Java community would be substantial.

Thank you for considering this request.

@magicprinc
Copy link
Author

IDEA supports them: even suggests removing code that checks this condition ;-)

But no runtime checks of course

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

No branches or pull requests

1 participant