Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2886

Incorrect JSR-305 nullability annotations

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.8.0
    • Affects Version/s: 3.7.0
    • Component/s: API
    • None

      Including nullness annotations in the 3.7.x series driver was a welcome addition. Thanks for adding this very useful metadata.

      There are a few places in the API where methods and parameters are (meta-)labeled with the wrong nullness annotation.

      Some examples, but far from exhaustive:

      1. com.mongodb.client.MongoCollection: The package has the NonNullApi meta-annotation. Methods in the findOneAnd$OP class can all return null, but are not annotated with @CheckForNull or @Nullable
      2. com.mongodb.client.model.Aggregates#group: The package has NonNullApi, but `null` has been an accepted parameter for TExpression id
      3. com.mongodb.client.model.Filters#eq: The package has NonNullApi, but `null` has been an accepted parameter for TItem value

            Assignee:
            Unassigned Unassigned
            Reporter:
            epkugelmass Elan Kugelmass
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: