False NullPointerException detection using Spring Assert.notNull

Please provide

  • Operating system: Windows 10
  • SonarQube for IntelliJ plugin version: 10.20.0.80985
  • IntelliJ version: Build #IU-243.26053.27,
  • Programming language you’re coding in: java
  • Is connected mode used: No
    • SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?):

And a thorough description of the problem / question:

Using Spring Core 6.2.2, I am getting a warning : A “NullPointerException” could be thrown; “getBody()” can return null.
For line 2 of this, even if line 1 is doing that check.
Assert.notNull(response.getBody(), CALL_TO_ADO_FAILED);
Assert.notNull(response.getBody().getValue(), ADO_RETURNED_NULL);

Hey there.

I’ve moved your post to the section on reporting false-positives.

Could you please include a complete reproducer?