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

Annotations should not be deprecated. #130

Closed
jtnord opened this issue Feb 18, 2017 · 4 comments · Fixed by #180
Closed

Annotations should not be deprecated. #130

jtnord opened this issue Feb 18, 2017 · 4 comments · Fixed by #180

Comments

@jtnord
Copy link

jtnord commented Feb 18, 2017

The findbugs annotations e.g. CheckForNull NonNull etc. should not be marked as deprecated and users should not be directed to use the JSR-305 equivalents.

JSR-305 is dormant, has been for a long while and shows no hope of ever producing an agreed set of annotations in our lifetime. Further more these annotations use javax. packages which it is not possible to use according to the Oracle Java binary licence, so applications can not use and ship these dependencies along with a JRE without violating the Oracle licence agreement.

F. JAVA TECHNOLOGY RESTRICTIONS. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun", “oracle” or similar convention as specified by Oracle in any naming convention designation.

The JSR-305 group has not defined any official releases according to its jsr page so the only implementations is a seemingly random implementation provided by the FindBugs team. Even if the team where experts on the JSR (which some where) they are not official as there has been no vote and are not available from the JSR hompage - so the javax package name restriction still applies.

So please remove the @Deprecated annotation from the spotbugs specific annotations or update the links to point to the new preferred non-jsr305 implementation to use instead.

@KengoTODA
Copy link
Member

This issue is same with findbugsproject/findbugs#88, and findbugsproject/findbugs#128 contains related discussion.

@iloveeclipse
Copy link
Member

@KengoTODA : do you plan to PR and merge that?

@KengoTODA
Copy link
Member

Do you mean #180? In my understanding that is still under discussion.

@iloveeclipse
Copy link
Member

I don't see any arguments against removing "deprecation" annotations from old FB annotations. JSR-305 is dead, everyone knows it, and the question whether we use some other library in the future is a bit different. Right now we have one set of deprecated annotations and one set of dead JSR-305 annotations violating javax package scope. We should of course leave JSR-305 in (there is a lot of code using that), but we should at least provide something which doesn't cause warnings in the code.

KengoTODA added a commit to KengoTODA/spotbugs that referenced this issue Sep 27, 2017
KengoTODA added a commit to KengoTODA/spotbugs that referenced this issue Sep 27, 2017
KengoTODA added a commit to KengoTODA/spotbugs that referenced this issue Sep 29, 2017
according to commit comment of d3b4194,
it is not reasonable to keep this annotation as deprecated.
We've made other annotations updated in that commit not deprecated,
then this annotation should be marked as non-deprecated too.
henrik242 pushed a commit that referenced this issue Oct 5, 2017
according to commit comment of d3b4194,
it is not reasonable to keep this annotation as deprecated.
We've made other annotations updated in that commit not deprecated,
then this annotation should be marked as non-deprecated too.
PhilippWendler added a commit to sosy-lab/java-common-lib that referenced this issue Oct 27, 2017
The first release of SpotBugs is backwards compatible, so almost nothing
changes, but you need to run "ant spotbugs" now.

Furthermore, we need to add a dependency on jsr305 for the
javax.annotations package, which was previously included in the
findbugs-annotations package, but this was actually bad because Guava
also has a dependency on jsr305, so we ended up with the annotations
twice on the class path.
In the future, we will probably need to migrate away from these
annotations, as both SpotBugs and Guava consider:
spotbugs/spotbugs#130
spotbugs/spotbugs#180
google/guava#2960
vorburger added a commit to vorburger/jetcd that referenced this issue Nov 7, 2018
lburgazzoli pushed a commit to etcd-io/jetcd that referenced this issue Nov 7, 2018
jmason added a commit to Swrve/rate-limited-logger that referenced this issue Nov 6, 2020
…riginals

As noted at spotbugs/spotbugs#130 , there are
problems with the JSR-305 FindBugs annotations we'd previously been
using for nullability and thread-safety annotations. It seems the safest
thing to do is switch to the Spotbugs and net.jcip annotations, instead,
keeping them as compileOnly dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants