method isInteger(BigDecimal number) isn't compliant with sonar rules
You should ignore the warning. However this warning is not unfounded as exceptions are costly (stack unwinding) and in this case the exception might even happen in maybe 90% of the cases.

So in this case preferably an alternative should be sought:

public boolean isInteger(BigDecimal number) {
    return number.stripTrailingZeros().scale() &lt;= 0;
}


Here stringTrailingZeros would turn 600.00 into 6E2, hence with scale -2, and 0.0600 would become 6E-2 with scale 2.

Less code, hence even Wally points on the Dilbert scale.

P.S. there exist SuppressWarning annotations for SonarLint, though neat programmer that I am, I do not know the warning key.