Skip to content

Add JSpecify annotations to defaults #88

Description

@jvz

As noted in https://issues.apache.org/jira/browse/LOG4J2-1477, JSpecify is the project specifying the one true nullability annotation standard. I experimented with creating copies of those annotations that use the JSR 305 nullability annotations to implement it, but it seems like it'd be easier to just use these annotations directly since they're only required at compile time. The use of these annotations would supersede any use of the old JSR annotations.

Activity

  1. ppkarwasz commented on Jan 1, 2024

    @ppkarwasz
    Member

    @jvz, can you list which tools currently support those annotations? I am mostly interested in Eclipse, IDEA, Spotbugs and some tool like NullAway or Checker Framework that guarantees that the code is NPE-free.

  2. jvz commented on Jan 2, 2024

    @jvz
    MemberAuthor

    I have no idea if any support this yet. I like the annotation scheme at least, though, if we want to use our own packaged annotations instead based on JSR 305 like I tried out before. That approach at least works with existing tools until JSpecify is directly supported.

  3. jvz commented on Jan 2, 2024

    @jvz
    MemberAuthor

    I just noticed that this can be done directly in Log4j for now. This will make it simpler to apply any rewrites to the annotations as tooling catches up. See apache/logging-log4j2@2da4108 for the aliasing.

  4. GregDThomas commented on Jan 2, 2024

    @GregDThomas

    which tools currently support those annotations? I am mostly interested in Eclipse, IDEA, Spotbugs and some tool like NullAway or Checker Framework t

    IntelliJ supports it (JetBrains are a member of the jspecify group - https://jspecify.dev/about)
    There's details on a fork of the checker framework at https://github.com/jspecify/jspecify-reference-checker

    No idea on Spotbugs/Eclipse I'm afraid.

  5. self-assigned this
    on Jan 9, 2024
  6. added a commit that references this issue on Jan 10, 2024
    9b35603
  7. added this to the 10.6.0 milestone on Jan 10, 2024
  8. added a commit that references this issue on Jan 11, 2024
    07b8196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions