Use primitive boolean expression here

What you will learn here about SonarQube

  • Use primitive boolean expression here

Here we will see how to solve one of the minot issue on SonarQube. On the SonarQube we will get Use primitive boolean expression here issue when we use boolean data type variable in if condition. So here we will see how to solve Use primitive boolean expression here issue on SonarQube.

Use primitive boolean expression here

On the SonarQube Use primitive boolean expression here issue comes when we are checking boolean variable in if condition which is shown below
use primitive boolean expression here

The solution for issue Use primitive boolean expression here is very simple:
Solution is
use Boolean.TRUE.equals(<boolean variable>) for boolean true check and
use Boolean.FALSE.equals(<boolean variable>) for boolean false check

use primitive boolean expression here SonarQube

You may also like...