Versions used
- SonarScanner 4.2.0.1873-macosx
- Sonarqube 8.2.0.32929 Docker
Error observed
With the following code block
if (FeatureFlag.DEBUG) {
MyLogger.d(TAG, "notifyFindContacts : "
+ "users=" + users != null ? Arrays.toString(users.toArray()) : "null"
+ ", buddies" + buddies != null ? Arrays.toString(buddies.toArray()) : "null");
}
This issue’s description says:
Change this condition so that it does not always evaluate to “true”
- Implies ‘users’ is not null.
"notifyFindContacts : "
+ "users=" + users
- Expression is always true.
"notifyFindContacts : "
+ "users=" + users != null
However, users is nullable and I guess there is something wrong with Sonarqube while parsing the string “user=”.