- 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()
.uri("http://localhost")
.retrieve()
.bodyToMono(String.class)
.block();
if(value!=null){ //<-- This can be null
}
Example: