Skip to content
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

Replace JSR-305 annotations with spotbugs annotations #361

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

MarkEWaite
Copy link

@MarkEWaite MarkEWaite commented May 7, 2024

Replace JSR-305 annotations with spotbugs annotations

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 instructions.

Testing done

Confirmed that automated tests pass on my Linux computer with Java 21 after the change.

Submitter checklist

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.

https://groups.google.com/g/jenkinsci-dev/c/uE1wwtVi1W0/m/gLxdEJmlBQAJ is
the mailing list discussion from James Nord that describes the affected
annotations and why they should be replaced with annotations that are
actively maintained.

https://www.jenkins.io/doc/developer/tutorial-improve/replace-jsr-305-annotations/
provides instructions to perform this change.

https://docs.openrewrite.org/recipes/jenkins/javaxannotationstospotbugs
provides an OpenRewrite recipe for the change.  The OpenRewrite recipe
is even better than the instructions.
@baev baev merged commit ccd1e5d into jenkinsci:master Oct 17, 2024
1 check passed
@baev
Copy link
Member

baev commented Oct 17, 2024

@MarkEWaite thanks!

@MarkEWaite MarkEWaite deleted the fix-jsr-305 branch October 17, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants