Adopt `JSpecify` for nullness
Since javax is deprecated. We should migrate from javax to jakarta.
This is not necessary. But I'd love to contribute if you want. :)
I don't know what javax to jakarta means.
@nedtwigg I believe that @qwertycxz is referring to all the javax.* annotations we use like javax.annotation.Nullable. They've been replaced with the jakarta.* package over the last few years as part of Oracle handing over Java EE to the Eclipse Foundation under the new name "Jakarta". This name change was some for copyright or trademark reasons, IIRC.
Long story short, Spring, Quarkus, etc. seem to use jakarta.* annotations nowadays, with Dagger 2 due to eventually adopt them too, so the OP is gently encouraging us to adopt Jakarta annotations, too.
That being said, for nullness specifically, JSpecify is the de facto standard nowadays, so we should migrate to JSpecify and adopt Jakarta to fill in any gaps.
What do you think? :)
I've followed the JSpecify nullness project, happy to take a PR for that. Find-replacing javax. to jakarta. seems like more churn than it's worth.
This would be not easy. I'm not sure if SpotBug support JSpecify. We may need EISOP as a new null checker.
Update: Here's a SpotBug plugin for JSpecify. But it was archived?
Update 2: A relative issue here.
Looks like there's two gradle plugins supporting JSpecify to some level out of the box:
- https://github.com/tbroyer/gradle-nullaway-plugin
- https://github.com/kelloggm/checkerframework-gradle-plugin
I have used @tbroyer stuff in the past, I think he's very good.
This would be not easy. I'm not sure if SpotBug support
JSpecify. We may need EISOP as a new null checker.Update: Here's a SpotBug plugin for
JSpecify. But it was archived?Update 2: A relative issue here.
Good observation about SpotBugs and JSpecify. I know that the SpotBugs team used to be part of the JSpecify committee, but they're no longer mentioned on the JSpecify website, so maybe there was a falling out or a difference in views on how nullness analysis should be done. So @nedtwigg's suggestion to use either NullAway or Checker Framework (ideally on top of SpotBugs) sounds good to me. 👍
What do you think about Spring’s nullability-plugin (https://github.com/spring-gradle-plugins/nullability-plugin)? Its repository code looks quite concise.