jenkinsci / prometheus-plugin

Jenkins Prometheus Plugin
https://plugins.jenkins.io/prometheus/
Apache License 2.0
181 stars 151 forks source link

Replace JSR-305 annotations with spotbugs annotations #660

Closed MarkEWaite closed 4 months ago

MarkEWaite commented 4 months ago

Replace JSR-305 annotations with spotbugs annotations

Changes proposed

Annotations for Nonnull, CheckForNull, and several others were proposed for Java as part of dormant Java specification request JSR-305. The proposal never became a part of standard Java.

Jenkins plugins should switch from using JSR-305 annotations to use Spotbugs annotations that provide the same semantics.

The mailing list discussion from James Nord describes the affected annotations and why they should be replaced with annotations that are actively maintained.

The "Improve a plugin" tutorial provides instructions to perform this change.

An OpenRewrite recipe is also available and is even better than the tutorial.

Checklist

Notify

@Waschndolos

Testing done

Confirmed that automated tests pass on Linux with Java 21.