S2259: False positive about NPE will be thrown

Please provide

  • Operating system: Windows 10
  • SonarLint plugin version:
  • Programming language you’re coding in: Java
  • Is connected mode used: No

The following snippet is reported a false positive for S2259:

Flow 1 which states "Implies ‘event’ is null is incorrect. If event is null then data will be null and the test for data != null would fail thus short-circuiting any call to goodEvent.

1 Like

Hello @Alain_Picard,

Thank you for reporting!
There is indeed an issue. I have created a ticket about it.