I have the following code in Java;
BigDecimal price; // assigned elsewhere if (price.compareTo(new BigDecimal(\"0.00\")) == 0) { return true; } <
BigDecimal price; // assigned elsewhere if (price.compareTo(new BigDecimal(\"0.00\")) == 0) { return true; }
There is a static constant that represents 0:
BigDecimal.ZERO.equals(selectPrice)
You should do this instead of:
selectPrice.equals(BigDecimal.ZERO)
in order to avoid the case where selectPrice is null.
selectPrice
null