# A false negative about the rule RSPEC-4454

**URL:** <https://community.sonarsource.com/t/a-false-negative-about-the-rule-rspec-4454/67417>\
**Category:** Report False-positive / False-negative...\
**Tags:** java, scanner\
**Created:** [July 4, 2022, 1:46pm UTC](https://community.sonarsource.com/t/a-false-negative-about-the-rule-rspec-4454/67417 "2022-07-04T13:46:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Belle](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/belle/32/28451_2.png) [@Belle](https://community.sonarsource.com/u/Belle)\
**Post date:** [July 4, 2022, 1:46pm UTC](https://community.sonarsource.com/t/a-false-negative-about-the-rule-rspec-4454/67417/1 "2022-07-04T13:46:24Z")

</div>

Hi, I found a false negative about the rule [RSPEC-4454](https://rules.sonarsource.com/java/RSPEC-4454). Please read the following code example.

I think `lombok.NonNull` ([Link](https://projectlombok.org/features/NonNull)) is a popular annotation and it is equivalent to `@Nonnull`. Hence, we should also consider this annotation and report a warning in line 3.

```java
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

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [July 4, 2022, 1:59pm UTC](https://community.sonarsource.com/t/a-false-negative-about-the-rule-rspec-4454/67417/2 "2022-07-04T13:59:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Belle](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/belle/32/28451_2.png) [@Belle](https://community.sonarsource.com/u/Belle)\
**Post date:** [July 6, 2022, 7:31am UTC](https://community.sonarsource.com/t/a-false-negative-about-the-rule-rspec-4454/67417/3 "2022-07-06T07:31:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/michael/32/43_2.png) [@Michael](https://community.sonarsource.com/u/Michael)\
**Post date:** [January 23, 2023, 7:32pm UTC](https://community.sonarsource.com/t/a-false-negative-about-the-rule-rspec-4454/67417/6 "2023-01-23T19:32:55Z")

</div>

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
