fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fineract] vorburger commented on a change in pull request #951: FINERACT-822 Enable Warnings CompareToZero
Date Mon, 01 Jun 2020 09:22:28 GMT

vorburger commented on a change in pull request #951:
URL: https://github.com/apache/fineract/pull/951#discussion_r433130044



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/interestratechart/data/InterestRateChartSlabDataValidator.java
##########
@@ -239,7 +239,7 @@ public void validateChartSlabsUpdate(final JsonElement element, final
DataValida
         }
 
         if (amountRangeFrom != null && amountRangeTo != null) {
-            if (amountRangeFrom.compareTo(amountRangeTo) > 1) {
+            if (amountRangeFrom.compareTo(amountRangeTo) > 0) {

Review comment:
       This is actually "fun"... I also had to read https://errorprone.info/bugpattern/CompareToZero
- and now I understand it. What's really interesting and not just fun is that in N places
of this PR you're just doing something to make EP happy, but in exactly 4 occurrences, you've
actually just fixed real bugs - see FINERACT-1014; thank You, Error Prone!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message