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

Ignore redundant null check error from Spotbugs

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.0.0
    • Affects Version/s: 4.0.0, 4.1.0
    • Component/s: Build
    • Labels:
      None

      See https://github.com/spotbugs/spotbugs/issues/756 for details.

      Essentially, Java 11 has changed the bytecode generation for try-with-resources, and it triggers this Spotbugs error wherever it's used:

      Bug type RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE
      

      Since this is a relatively harmless mistake in handwritten code, and try-with-resources is quite nice syntactically, let's disable the check.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: