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

Replace JetBrains annotations with Spring ones #296

Closed
ledsoft opened this issue Sep 12, 2024 · 3 comments · Fixed by #301
Closed

Replace JetBrains annotations with Spring ones #296

ledsoft opened this issue Sep 12, 2024 · 3 comments · Fixed by #301
Assignees

Comments

@ledsoft
Copy link
Contributor

ledsoft commented Sep 12, 2024

A mix of JetBrains (org.jetbrains.annotations, e.g. @NotNull) and Spring (org.springframework.lang, e.g., @NonNull) is used within TermIt. We need to unify these to the Spring-based ones.

@lukaskabc
Copy link
Collaborator

lukaskabc commented Sep 13, 2024

I am looking at the options, and I think we should consider JSpecify annotations.

jakarta.validation.constraints.NotNull is used for bean validation. This should stay unchanged for runtime bean validation.

There are also Nonnull and Nullable from jakarta.annotation that are intended for static analysis.

Spring's @NonNull currently uses Nonnull from the old javax.
However, they seem to be planning a migration to JSpecify.

I suggest using JSpecify, too.

https://jspecify.dev/

@ledsoft

IDE configuration

Once this is resolved, it is possible to change the Intellij idea configuration to use desired annotations for code generation instead of the ones from Jetbrains. And it should be mentioned in implementation docs.

https://www.jetbrains.com/help/idea/annotating-source-code.html#nullability-annotations

@ledsoft
Copy link
Contributor Author

ledsoft commented Sep 16, 2024

I would actually prefer the standard Jakarta Nonnull. It seems to work with IDEA out of the box and we already depend on Jakarta annotations.
Let's put this one on hold, I will ask a friend at Payara what they use.

@ledsoft
Copy link
Contributor Author

ledsoft commented Sep 16, 2024

Ok, I suggest going with the standard Jakarta annotations. It requires no additional dependencies and works fine with IDEs without any extra configuration.

lukaskabc added a commit to lukaskabc/termit that referenced this issue Sep 19, 2024
@ledsoft ledsoft linked a pull request Sep 23, 2024 that will close this issue
ledsoft added a commit that referenced this issue Sep 23, 2024
[Ref #296] Replacing nullability annotations with jakarta
@ledsoft ledsoft closed this as completed Sep 23, 2024
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 a pull request may close this issue.

2 participants