Giter VIP home page Giter VIP logo

Comments (8)

uhafner avatar uhafner commented on August 16, 2024 1

I am fine with it. The idea is just to make @CheckForNull another supported nullable annotation, right? As an exact alias for @Nullable, correct?

Yes, just an alias for @Nullable. (The reason is that SpotBugs treats @Nullable differently: such references might be null but should not be flagged by a tool. In Spotbugs the semantics of @CheckForNull is the same as your @Nullable annotation). Then teams can use SpotBugs and NullAway to check the code...

from nullaway.

msridhar avatar msridhar commented on August 16, 2024

Which library provides the @CheckForNull annotation?

from nullaway.

ben-manes avatar ben-manes commented on August 16, 2024

javax.annotation (jsr305 / findbugs)

from nullaway.

msridhar avatar msridhar commented on August 16, 2024

Cool, this should be easy to support

from nullaway.

chengniansun avatar chengniansun commented on August 16, 2024

Just for your information, Guava is migrating off from jsr305.

google/guava#2960

from nullaway.

uhafner avatar uhafner commented on August 16, 2024

Are you ok with a pull request that adds support for a @CheckForNull annotation? From the code it looks like that I just need to update

public static boolean isNullableAnnotation(String annotName, Config config) {
and provide a test.

Or is there something conceptional wrong with this issue? Supporting CheckForNull would help projects a lot that use NullAway and SpotBugs

from nullaway.

msridhar avatar msridhar commented on August 16, 2024

I would be open to a PR that just adds @CheckForNull support. @lazaroclapp please comment if you see an issue with that.

from nullaway.

lazaroclapp avatar lazaroclapp commented on August 16, 2024

I am fine with it. The idea is just to make CheckForNull another supported nullable annotation, right? As an exact alias for @Nullable, correct? Reading the previous discussion, we were a bit concerned about overhead of equality checking so many annotations if we just supported a custom list. But given that there seems to be interest for this particular annotation, I'd say go ahead.

We can open a separate task to optimize isNullableAnnotation and profile later.

from nullaway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.