erik-meuwese-topicus opened a new pull request, #443: URL: https://github.com/apache/maven-build-cache-extension/pull/443
Migrate from JSR-305 tot JSpecify Maven Build Cache Extension depends on JSR-250: Common Annotations for the Java Platform (javax.annotation) which exports the `javax.annotation` package. The JSR-305: Annotations for Software Defect Detection (jsr305) part of Google Findbugs also exports the `javax.annotation` package. With JPMS it's not possible to compile having both dependencies. [JSpecify ](https://jspecify.dev/) standerdizes the `@Nullable` and `@NonNull` annotations. ### Changes - Replaced the dependency jsr305 with jspecify - Replaced the `@javax.annotation.Nonnull` and `@javax.annotation.Nullable` annotation to the `@org.jspecify.annotations.NonNull` and `@org.jspecify.annotations.Nullable` annotations - Added `@Nullable` to return values and parameters which could be null - Added checks to `PluginScanConfigImpl` `isSkip()` and `accept(tagName)` to prevent NullPointenException when dto is null - Added `@NonNull` to return values of `CacheContext` and `CacheResult` for values set with `requireNonNull(value)` - Changed `@NonNull` to `@Nullable` in `RemoteCacheRepository` `getResourceUrl(context, filename)` because implementation `RemoteCacheRepositoryNoOp` returned `null` so it's nullable ### Further improvement When Maven Build Cache Extesion changes `<javaVersion>8</javaVersion>` in the pom.xml to Java 9+. Then it would become possible to remove all `@NonNull` annotations and annotate the packages with `@NullMarked`. Because `@NullMarked` targets `MODULE` which has been added in Java 9 so `MODULE` is not compatible with Java 8. With `@NullMarked` every return value and parameter is considered `@NonNull` unless annotated with `@Nullable`. This reduces the amount of annotations needed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
