A false negative about the rule RSPEC-4454

Hi, I found a false negative about the rule RSPEC-4454. Please read the following code example.

I think lombok.NonNull (Link) is a popular annotation and it is equivalent to @Nonnull. Hence, we should also consider this annotation and report a warning in line 3.

import lombok.NonNull;
public class Test {
  public boolean equals(@NonNull Object obj) { // should report a warning in this line
  }
}

SonarQube version: 9.2.3
SonarScanner version: 4.6.2

Hey there.

We improved support for nullability annotations in SonarQube v9.3. The latest version of SonarQube (and only supported v9.x version) is v9.5. Can you upgrade and see if the false-positive persists?

Hi Colin, thanks for your reply. I have checked by SonarQube 9.5.0, and the false negative still cannot be detected.

Hey @Belle ,

Sorry for reviving this thread. I can not reproduce the FN with the latest released version of the java analyzer (deployed on SonarCloud already and soon with SQ 9.9). Currently, the rule behaves correctly and raises an issue when using lombok.NonNull, as expected.

I could not track starting from which version the FN might have disappeared, but it should be fixed by now. Let me know if you still suffer from it.

Finally, note that the code that you provided does not compile (no return value). This might lead the java analyzer to not behave as expected.

Cheers,
Michael