Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6910061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:46:00+00:00 2026-05-27T08:46:00+00:00

I found inconvenient that checkNotNull() precondition in guava is not marked with @Nonull annotation.

  • 0

I found inconvenient that checkNotNull() precondition in guava is not marked with @Nonull annotation. Consider following example:

State(Set<Model> models, Set<Variation> variations) {
  this.models = checkNotNull(models);
  this.variations = checkNotNull(variations);

  if (this.variations == null) {
     throw new IllegalArgumentException();
  }
  this.engine = createEngine();
}

So IDE could not found that variations == null is always false. Is there any particular reasons why this precondition is not marked with @Nonull (even if it’s arguments are defined using @Nullable).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:46:01+00:00Added an answer on May 27, 2026 at 8:46 am

    We haven’t used @Nonnull anywhere, sorry. Why? We tried adding more null-checking annotations, and we found that:

    • Adding all the other annotations is highly verbose.
    • @Nullable is all we need for NullPointerTester. Admittedly that’s more important to Guava developers than Guava users.
    • @Nullable appeared to have caught most problems. I admit it’s hard to say how many un-checked-in bugs other annotations would have caught before the user found them.

    The verbosity was the main thing. It gets crazy, especially with subtyping and with parameterized types. We tried to pick a sweet spot for annotations. Maybe we’ll change it one day. For the moment, though, that’s why things are the way they are.

    (If we did do something, I suspect we’d try to make @Nonnull the default, using @CheckForNull for the exceptions instead. But I haven’t looked into it even enough to make sure I’ve got the meanings right.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to use $.cssRule() plugin and found that it makes it inconvenient to
Found the following in an Oracle-based application that we're migrating (generalized) : SELECT Table1.Category1,
Found a piece of code today, that I find a little smelly... TMyObject.LoadFromFile(const filename:
I found this open-source library that I want to use in my Java application.
I've googled this and found that it's almost impossible to create a database with
I've been going through the tutorial at hginit.com, but I've found a rather inconvenient
Found the following snippet on the Closure page on wikipedia //# Return a list
found the following code: XmlDocument cfgDoc = new XmlDocument(); loadConfigDoc(cfgDoc); // retrieve the appSettings
Found similar questions but nothing that covers exactly what I need. I kept it
I have been coding around with Google Geocoding until I found out that the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.