@Nullable in block() is not evaluated and leads to "Expression is allways true"

  • SonarQube Community Edition Version 7.9.4
  • SonarJava 6.3.2 (build 22818)
  • Rule S2589

block() function has @Nullable but is not taken in consideration and if condition leads to “Expression is allways true”

String value = WebClient.builder().build().get()
if(value!=null){ //<-- This can be null


Hello @Francesc_Jorda and welcome to the community!

Supported annotations for this rule are listed here.
Note that we recently updated the list, it will be effective for SonarQube 8.6 and already on SonarCloud.

Can you provide us the fully qualified name of the @Nullable annotation which is not taken into consideration? If it is not already in the list, I would be happy to extend it.


I’ve checked and is not in the list.
The one missing for us is:

thank you!

Thanks for the update.

Ticket created: SONARJAVA-3586.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.