-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Please add NonNull/Nullable annotations #248
Comments
Which ones? there are almost too many such annotations, and several of those projects are dead or have very little activity. |
I'd choose between JSR305 ( The full list of annotations supported by Kotlin lang can be found here: https://github.com/JetBrains/kotlin/blob/master/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/JvmAnnotationNames.kt |
According to https://jcp.org/en/jsr/detail?id=305 JSR 305 is dormant for over 7 years now. |
This is also mentioned in jakartaee/common-annotations-api#50, so in a future version we might simply use Jakarta Annotations (which is already used by SI Units 2.x) for both purposes. |
For the reasons mentioned by @keilw in the above two comments, I would also not investigate such a possibility at the moment. |
@remal What would the annotations bring in particular, and have you checked https://github.com/Tenkiv/Physikal for use with Kotlin? |
|
Well 2.0 is already done, but we could include it in a follow up version. |
Just to be on the same page. @keilw, you're going to add @NonNull/Nullable annotations to one of the next versions, right? |
@remal If there is a more stable spec like Jakarta Annotations including such annotations, we might do that I see no reason against it, especially |
We won't do that until Jakarta Annotations included the currently defunct JSR 305 annotations: jakartaee/common-annotations-api#50 |
@remal @thodorisbais after looking at this again, quite frankly I would leave it to application code to apply a |
@keilw Basically, this issue is not about runtime checks inside the library itself - it's mainly about static analysis. Indeed, Java developers won't benefit much from it (only from static analysis perspective), but Kotlin developers will, as Kotlin handles nullity annotations and behaves accordingly. |
@remal Unfortunately there is no accepted standard for that, see https://stackoverflow.com/questions/4963300/which-notnull-java-annotation-should-i-use. So please keep an eye on Jakarta Annotations, if they ever pick up the "Walking Dead" of JSR 305 we might consider that (as we already support Jakarta Annotations even all the way down to the API) feel free to raise a new ticket, but in the meantime it makes no sense. |
I'd like to use the library with Kotlin language, which can handle
NonNull
/Nullable
annotations during compile-time.Please add these annotations in the library. If you want, I can do it myself by sending a PR.
The text was updated successfully, but these errors were encountered: