fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fineract] percyashu commented on a change in pull request #1099: FINERACT-822 Enforce UndefinedEquals check
Date Tue, 23 Jun 2020 11:14:08 GMT

percyashu commented on a change in pull request #1099:
URL: https://github.com/apache/fineract/pull/1099#discussion_r444145876



##########
File path: fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java
##########
@@ -100,8 +100,9 @@ public boolean equals(Object obj) {
         }
         TrialBalance other = (TrialBalance) obj;
         return Objects.equals(other.officeId, officeId) && Objects.equals(other.glAccountId,
glAccountId)
-                && Objects.equals(other.amount, amount) && Objects.equals(other.entryDate,
entryDate)
-                && Objects.equals(other.transactionDate, transactionDate) &&
Objects.equals(other.closingBalance, closingBalance);
+                && Objects.equals(other.amount, amount) && other.entryDate.compareTo(entryDate)
== 0 ? Boolean.TRUE

Review comment:
       Error Prone kept complaining java.util.Date equals() doesn't seem to work as expected.
This is because from [this](https://docs.oracle.com/javase/6/docs/api/java/util/Date.html#equals(java.lang.Object))
two Date objects are equal if and only if the getTime method returns the same long value for
both.




----------------------------------------------------------------
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