Skip to content

Should we use javax.annotation.Nullable and javax.annotation.concurrent.Immutable #182

Closed

Description

@aozarov

Part of JSR-305.

These annotations are part of Java 8, but could be used before by including this dependency

<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>

Activity

  1. added
    type: questionRequest for information or clarification. Not an issue.
    on Sep 26, 2015
  2. changed the title [-]Consider using javax.annotation.Nullable and javax.annotation.concurrent.Immutable[/-] [+]Should we use javax.annotation.Nullable and javax.annotation.concurrent.Immutable[/+] on Sep 26, 2015
  3. eamonnmcmanus commented on Sep 28, 2015

    @eamonnmcmanus
    Contributor

    Actually the annotations are not part of Java 8, which is good because you can include them from the jsr305 jar and it will work the same everywhere. What changes in Java 8 is that you have type annotations, so you can write things like List<@Nullable String>. Conversely, you can't write that if you want to compile on earlier versions, though you can still write @Nullable String frob(@Nullable String s).

    @Nullable in particular can provide a useful service to client code if that code is using FindBugs or another similar tool.

  4. garrettjonesgoogle commented on Nov 23, 2016

    @garrettjonesgoogle
    Contributor

    Stale issue, closing out.

  5. added a commit that references this issue on Aug 9, 2022
  6. added a commit that references this issue on Dec 22, 2025
  7. added a commit that references this issue on Feb 24, 2026
  8. added a commit that references this issue on Mar 12, 2026
  9. added a commit that references this issue on Mar 30, 2026
  10. added a commit that references this issue on Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions