SonarLint and SonarQube differences for JAVA

Hello,

  • Operating system: Mac OSX
  • SonarLint plugin version: 8.1.0.65508 on IntelliJ 2023.1 (CE)
  • Programming language you’re coding in: Java
  • Is connected mode used: SonarQube 9.9

My problem is the same as referenced on some issues like :

Here are my snapshots.
IntelliJ after an SonarLint Analysis

SonarQube

IntelliJ version / SonarLint version :


We can see the last issue appearing in SonarQube with message A "NullPointerException" could be thrown; "cAddresses" is nullable here. doesn’t appear in SonarLint analysis. This rule has the id “java:S2259”.

As you can see in my IntelliJ snasphot, I try to add “SonarQubeTestProject>false” property in my pom.xml file but, I have the same result : issue isn’t raised in SonarLint

I recreated my IntelliJ workspace from scratch.
I checked SonarlInt configuration : pointing on the good SonarQube project
I reloaded SonarLint local Storage (by clicking on button)

I have no file excluded.

I have now no idea for this problem.
Could you give me some support, please ?

thank you.

David.

Hello @dedece35,

Thanks for raising this problem here.

The SonarQubeTestProject property is only relevant in the context of the scanner for MSBuild. In your context it is simply ignored.

Without seeing the code, it’s hard for us to tell what happens, could you share with us a small reproducer project ?