-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Looks like the project uses jakarta.annotation:jakarta.annotation-api for nullability annotations, however, there are several issues with that:
-
jakarta has problematic license: it is a mix of EPL 2.0, GPL2 w CPE (see https://repo1.maven.org/maven2/jakarta/annotation/jakarta.annotation-api/3.0.0/jakarta.annotation-api-3.0.0.pom). Apache Software foundation legals do not appreciate those types of licenses, see https://www.apache.org/legal/resolved.html#category-x
-
There's a standard way of handling nullability: https://jspecify.dev/
It covers nullability much better, and the tooling is much better there.
The rule of thumb with JSpecify is as follows:
a) Prefer non-null by default, thus in 99% of the cases you should NOT use @Nonnull.
b) Mark every package as @NullMarked: create package-info.java and mark it with @NullMarked. There's no "package with subpackages" since a subpackage might come in a different jar which might have never heard of jspecify
c) @Nullable is a type annotation, so it should be placed closer to a type. So you should prefer public @Nullable String getShortOpt() rather than @Nullable public String getShortOpt(). At the end of the day, what does "nullable method" mean?
PS I identified the issue when upgrading ph-css in JMeter