This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new f1a06b4  FINERACT-822 Enforce UndefinedEquals check (#1099)
f1a06b4 is described below

commit f1a06b42d7d4564ea8628a1e976799cd0625b966
Author: Percy Ayuk Ashu <[email protected]>
AuthorDate: Tue Jun 23 21:36:52 2020 +0100

    FINERACT-822 Enforce UndefinedEquals check (#1099)
---
 fineract-provider/build.gradle                         |  2 +-
 .../accounting/glaccount/domain/TrialBalance.java      |  5 +++--
 .../service/AccountingProcessorHelper.java             |  4 +++-
 ...rnalEntryWritePlatformServiceJpaRepositoryImpl.java |  7 +++++--
 ...ngEntriesWritePlatformServiceJpaRepositoryImpl.java |  2 +-
 .../data/EntityDataTableChecksTemplateData.java        |  4 +++-
 .../fineract/portfolio/calendar/data/CalendarData.java |  7 +++++--
 .../fineract/portfolio/group/data/CenterData.java      | 10 ++++++----
 .../portfolio/group/data/GroupGeneralData.java         | 18 +++++++++++-------
 .../fineract/portfolio/loanaccount/domain/Loan.java    | 12 +++++++-----
 .../loanaccount/domain/LoanDisbursementDetails.java    |  3 ++-
 .../portfolio/savings/domain/SavingsAccountCharge.java | 18 +++++++++++-------
 .../portfolio/shareaccounts/domain/ShareAccount.java   | 13 +++++++------
 .../portfolio/shareproducts/domain/ShareProduct.java   |  2 +-
 14 files changed, 66 insertions(+), 41 deletions(-)

diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index 26e48fd..7d05e71 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -385,7 +385,6 @@ tasks.withType(JavaCompile) {
                 "UnusedVariable",
                 "SameNameButDifferent",
                 "TypeParameterUnusedInFormals",
-                "UndefinedEquals",
                 "JdkObsolete",
                 "EmptyBlockTag",
                 "MissingSummary",
@@ -453,6 +452,7 @@ tasks.withType(JavaCompile) {
                 "NarrowingCompoundAssignment",
                 "MissingCasesInEnumSwitch",
                 "ReferenceEquality",
+                "UndefinedEquals",
                 "OperatorPrecedence",
                 "EqualsGetClass",
                 "EqualsUnsafeCast",
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java
 
b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java
index 11804ca..f74f35e 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/accounting/glaccount/domain/TrialBalance.java
@@ -100,8 +100,9 @@ public class TrialBalance extends AbstractPersistableCustom 
{
         }
         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
+                        : Boolean.FALSE && 
other.transactionDate.compareTo(transactionDate) == 0 ? Boolean.TRUE
+                                : Boolean.FALSE && 
Objects.equals(other.closingBalance, closingBalance);
     }
 
     @Override
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
 
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
index b555f74..5d98dcd 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java
@@ -530,7 +530,9 @@ public class AccountingProcessorHelper {
          * check if an accounting closure has happened for this branch after 
the transaction Date
          **/
         if (latestGLClosure != null) {
-            if (latestGLClosure.getClosingDate().after(transactionDate) || 
latestGLClosure.getClosingDate().equals(transactionDate)) {
+            if (latestGLClosure.getClosingDate().after(transactionDate) || 
latestGLClosure.getClosingDate().compareTo(transactionDate) == 0
+                    ? Boolean.TRUE
+                    : Boolean.FALSE) {
                 throw new 
JournalEntryInvalidException(GlJournalEntryInvalidReason.ACCOUNTING_CLOSED, 
latestGLClosure.getClosingDate(),
                         null, null);
             }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
index 15295e0..6700e4c 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/JournalEntryWritePlatformServiceJpaRepositoryImpl.java
@@ -346,7 +346,8 @@ public class 
JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
         final GLClosure latestGLClosureByBranch = 
this.glClosureRepository.getLatestGLClosureByBranch(officeId);
         if (latestGLClosureByBranch != null) {
             if 
(latestGLClosureByBranch.getClosingDate().after(journalEntriesTransactionDate)
-                    || 
latestGLClosureByBranch.getClosingDate().equals(journalEntriesTransactionDate)) 
{
+                    || 
latestGLClosureByBranch.getClosingDate().compareTo(journalEntriesTransactionDate)
 == 0 ? Boolean.TRUE
+                            : Boolean.FALSE) {
                 final String accountName = null;
                 final String accountGLCode = null;
                 throw new 
JournalEntryInvalidException(GlJournalEntryInvalidReason.ACCOUNTING_CLOSED,
@@ -597,7 +598,9 @@ public class 
JournalEntryWritePlatformServiceJpaRepositoryImpl implements Journa
         // shouldn't be before an accounting closure
         final GLClosure latestGLClosure = 
this.glClosureRepository.getLatestGLClosureByBranch(command.getOfficeId());
         if (latestGLClosure != null) {
-            if (latestGLClosure.getClosingDate().after(transactionDate) || 
latestGLClosure.getClosingDate().equals(transactionDate)) {
+            if (latestGLClosure.getClosingDate().after(transactionDate) || 
latestGLClosure.getClosingDate().compareTo(transactionDate) == 0
+                    ? Boolean.TRUE
+                    : Boolean.FALSE) {
                 throw new 
JournalEntryInvalidException(GlJournalEntryInvalidReason.ACCOUNTING_CLOSED, 
latestGLClosure.getClosingDate(),
                         null, null);
             }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java
 
b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java
index d708b03..2ddbf4a 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/accounting/provisioning/service/ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl.java
@@ -133,7 +133,7 @@ public class 
ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl implements
     private void validateForCreateJournalEntry(ProvisioningEntryData 
existingEntry, ProvisioningEntry requested) {
         Date existingDate = existingEntry.getCreatedDate();
         Date requestedDate = requested.getCreatedDate();
-        if (existingDate.after(requestedDate) || 
existingDate.equals(requestedDate)) {
+        if (existingDate.after(requestedDate) || 
existingDate.compareTo(requestedDate) == 0 ? Boolean.TRUE : Boolean.FALSE) {
             throw new 
ProvisioningJournalEntriesCannotbeCreatedException(existingEntry.getCreatedDate(),
 requestedDate);
         }
     }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/EntityDataTableChecksTemplateData.java
 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/EntityDataTableChecksTemplateData.java
index 34c95c2..79145be 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/EntityDataTableChecksTemplateData.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/EntityDataTableChecksTemplateData.java
@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.fineract.portfolio.loanproduct.data.LoanProductData;
 import org.apache.fineract.portfolio.savings.data.SavingsProductData;
 
@@ -69,7 +70,8 @@ public class EntityDataTableChecksTemplateData implements 
Serializable {
         return Objects.equals(entities, that.entities) && 
Objects.equals(statusClient, that.statusClient)
                 && Objects.equals(statusGroup, that.statusGroup) && 
Objects.equals(statusSavings, that.statusSavings)
                 && Objects.equals(statusLoans, that.statusLoans) && 
Objects.equals(datatables, that.datatables)
-                && Objects.equals(loanProductDatas, that.loanProductDatas) && 
Objects.equals(savingsProductDatas, that.savingsProductDatas);
+                && CollectionUtils.isEqualCollection(loanProductDatas, 
that.loanProductDatas)
+                && CollectionUtils.isEqualCollection(savingsProductDatas, 
that.savingsProductDatas);
     }
 
     @Override
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java
index dc70ba6..3037ce0 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/data/CalendarData.java
@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.fineract.infrastructure.core.data.EnumOptionData;
 import org.apache.fineract.portfolio.calendar.domain.CalendarFrequencyType;
 import org.apache.fineract.portfolio.calendar.domain.CalendarRemindBy;
@@ -525,8 +526,10 @@ public final class CalendarData implements Serializable {
                 && Objects.equals(frequency, that.frequency) && 
Objects.equals(interval, that.interval)
                 && Objects.equals(repeatsOnDay, that.repeatsOnDay) && 
Objects.equals(repeatsOnNthDayOfMonth, that.repeatsOnNthDayOfMonth)
                 && Objects.equals(remindBy, that.remindBy) && 
Objects.equals(firstReminder, that.firstReminder)
-                && Objects.equals(secondReminder, that.secondReminder) && 
Objects.equals(recurringDates, that.recurringDates)
-                && Objects.equals(nextTenRecurringDates, 
that.nextTenRecurringDates) && Objects.equals(humanReadable, that.humanReadable)
+                && Objects.equals(secondReminder, that.secondReminder)
+                && CollectionUtils.isEqualCollection(recurringDates, 
that.recurringDates)
+                && CollectionUtils.isEqualCollection(nextTenRecurringDates, 
that.nextTenRecurringDates)
+                && Objects.equals(humanReadable, that.humanReadable)
                 && Objects.equals(recentEligibleMeetingDate, 
that.recentEligibleMeetingDate)
                 && Objects.equals(createdDate, that.createdDate) && 
Objects.equals(lastUpdatedDate, that.lastUpdatedDate)
                 && Objects.equals(createdByUserId, that.createdByUserId) && 
Objects.equals(createdByUsername, that.createdByUsername)
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/CenterData.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/CenterData.java
index 6666d5a..1da1f59 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/CenterData.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/CenterData.java
@@ -23,6 +23,7 @@ import java.math.BigDecimal;
 import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.fineract.infrastructure.codes.data.CodeValueData;
 import org.apache.fineract.infrastructure.core.data.EnumOptionData;
 import org.apache.fineract.infrastructure.dataqueries.data.DatatableData;
@@ -280,11 +281,12 @@ public final class CenterData implements Serializable {
                 && Objects.equals(officeName, that.officeName) && 
Objects.equals(staffId, that.staffId)
                 && Objects.equals(staffName, that.staffName) && 
Objects.equals(hierarchy, that.hierarchy)
                 && Objects.equals(status, that.status) && 
Objects.equals(activationDate, that.activationDate)
-                && Objects.equals(timeline, that.timeline) && 
Objects.equals(groupMembers, that.groupMembers)
-                && Objects.equals(groupMembersOptions, 
that.groupMembersOptions)
+                && Objects.equals(timeline, that.timeline) && 
CollectionUtils.isEqualCollection(groupMembers, that.groupMembers)
+                && CollectionUtils.isEqualCollection(groupMembersOptions, 
that.groupMembersOptions)
                 && Objects.equals(collectionMeetingCalendar, 
that.collectionMeetingCalendar)
-                && Objects.equals(closureReasons, that.closureReasons) && 
Objects.equals(officeOptions, that.officeOptions)
-                && Objects.equals(staffOptions, that.staffOptions) && 
Objects.equals(totalCollected, that.totalCollected)
+                && CollectionUtils.isEqualCollection(closureReasons, 
that.closureReasons)
+                && CollectionUtils.isEqualCollection(officeOptions, 
that.officeOptions)
+                && CollectionUtils.isEqualCollection(staffOptions, 
that.staffOptions) && Objects.equals(totalCollected, that.totalCollected)
                 && Objects.equals(totalOverdue, that.totalOverdue) && 
Objects.equals(totaldue, that.totaldue)
                 && Objects.equals(installmentDue, that.installmentDue) && 
Objects.equals(datatables, that.datatables)
                 && Objects.equals(rowIndex, that.rowIndex) && 
Objects.equals(dateFormat, that.dateFormat)
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java
index e9503ac..cfc3f69 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java
@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.fineract.infrastructure.codes.data.CodeValueData;
 import org.apache.fineract.infrastructure.core.data.EnumOptionData;
 import org.apache.fineract.infrastructure.dataqueries.data.DatatableData;
@@ -380,14 +381,17 @@ public class GroupGeneralData implements Serializable {
                 && Objects.equals(officeName, that.officeName) && 
Objects.equals(centerId, that.centerId)
                 && Objects.equals(centerName, that.centerName) && 
Objects.equals(staffId, that.staffId)
                 && Objects.equals(staffName, that.staffName) && 
Objects.equals(hierarchy, that.hierarchy)
-                && Objects.equals(groupLevel, that.groupLevel) && 
Objects.equals(clientMembers, that.clientMembers)
-                && Objects.equals(activeClientMembers, 
that.activeClientMembers) && Objects.equals(groupRoles, that.groupRoles)
-                && Objects.equals(calendarsData, that.calendarsData)
+                && Objects.equals(groupLevel, that.groupLevel) && 
CollectionUtils.isEqualCollection(clientMembers, that.clientMembers)
+                && CollectionUtils.isEqualCollection(activeClientMembers, 
that.activeClientMembers)
+                && CollectionUtils.isEqualCollection(groupRoles, 
that.groupRoles)
+                && CollectionUtils.isEqualCollection(calendarsData, 
that.calendarsData)
                 && Objects.equals(collectionMeetingCalendar, 
that.collectionMeetingCalendar)
-                && Objects.equals(centerOptions, that.centerOptions) && 
Objects.equals(officeOptions, that.officeOptions)
-                && Objects.equals(staffOptions, that.staffOptions) && 
Objects.equals(clientOptions, that.clientOptions)
-                && Objects.equals(availableRoles, that.availableRoles) && 
Objects.equals(selectedRole, that.selectedRole)
-                && Objects.equals(closureReasons, that.closureReasons) && 
Objects.equals(timeline, that.timeline)
+                && CollectionUtils.isEqualCollection(centerOptions, 
that.centerOptions)
+                && CollectionUtils.isEqualCollection(officeOptions, 
that.officeOptions)
+                && CollectionUtils.isEqualCollection(staffOptions, 
that.staffOptions)
+                && CollectionUtils.isEqualCollection(clientOptions, 
that.clientOptions)
+                && CollectionUtils.isEqualCollection(availableRoles, 
that.availableRoles) && Objects.equals(selectedRole, that.selectedRole)
+                && CollectionUtils.isEqualCollection(closureReasons, 
that.closureReasons) && Objects.equals(timeline, that.timeline)
                 && Objects.equals(datatables, that.datatables) && 
Objects.equals(rowIndex, that.rowIndex)
                 && Objects.equals(dateFormat, that.dateFormat) && 
Objects.equals(locale, that.locale)
                 && Objects.equals(submittedOnDate, that.submittedOnDate);
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
index 369397e..024ff00 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java
@@ -2529,7 +2529,7 @@ public class Loan extends AbstractPersistableCustom {
         Date date = null;
         for (LoanDisbursementDetails disbursementDetail : 
this.disbursementDetails) {
             if (disbursementDetail.actualDisbursementDate() == null) {
-                if (date == null || 
disbursementDetail.expectedDisbursementDate().equals(date)) {
+                if (date == null || 
disbursementDetail.expectedDisbursementDate().compareTo(date) == 0 ? 
Boolean.TRUE : Boolean.FALSE) {
                     disbursementDetails.add(disbursementDetail);
                     date = disbursementDetail.expectedDisbursementDate();
                 } else if 
(disbursementDetail.expectedDisbursementDate().before(date)) {
@@ -2549,7 +2549,7 @@ public class Loan extends AbstractPersistableCustom {
             for (LoanDisbursementDetails disbursementDetail : 
this.disbursementDetails) {
                 if (disbursementDetail.actualDisbursementDate() != null) {
                     if (disbursementDetail.actualDisbursementDate().after(date)
-                            || 
disbursementDetail.actualDisbursementDate().equals(date)) {
+                            || 
disbursementDetail.actualDisbursementDate().compareTo(date) == 0 ? Boolean.TRUE 
: Boolean.FALSE) {
                         date = disbursementDetail.actualDisbursementDate();
                         details = disbursementDetail;
                     }
@@ -2752,7 +2752,7 @@ public class Loan extends AbstractPersistableCustom {
         if (getExpectedFirstRepaymentOnDate() != null
                 && 
(disbursedOn.isAfter(this.fetchRepaymentScheduleInstallment(1).getDueDate())
                         || 
disbursedOn.isAfter(getExpectedFirstRepaymentOnDate()))
-                && disbursedOn.toDate().equals(this.actualDisbursementDate)) {
+                && disbursedOn.toDate().compareTo(this.actualDisbursementDate) 
== 0 ? Boolean.TRUE : Boolean.FALSE) {
             final String errorMessage = "submittedOnDate cannot be after the 
loans  expectedFirstRepaymentOnDate: "
                     + getExpectedFirstRepaymentOnDate().toString();
             throw new InvalidLoanStateTransitionException("disbursal", 
"cannot.be.after.expected.first.repayment.date", errorMessage,
@@ -3970,7 +3970,8 @@ public class Loan extends AbstractPersistableCustom {
         boolean isRegenerationRequired = false;
         if (this.loanProduct.isMultiDisburseLoan()) {
             LoanDisbursementDetails details = fetchLastDisburseDetail();
-            if (details != null && 
!details.expectedDisbursementDate().equals(details.actualDisbursementDate())) {
+            if (details != null && 
details.expectedDisbursementDate().compareTo(details.actualDisbursementDate()) 
== 0 ? Boolean.FALSE
+                    : Boolean.TRUE) {
                 isRegenerationRequired = true;
             }
         }
@@ -6016,7 +6017,8 @@ public class Loan extends AbstractPersistableCustom {
             if ((loanTermVariations.getTermType().isDueDateVariation()
                     && 
loanTermVariations.fetchDateValue().isAfter(actualDisbursementDate))
                     || (loanTermVariations.getTermType().isEMIAmountVariation()
-                            && 
loanTermVariations.getTermApplicableFrom().equals(actualDisbursementDate.toDate()))
+                            && 
loanTermVariations.getTermApplicableFrom().compareTo(actualDisbursementDate.toDate())
 == 0 ? Boolean.TRUE
+                                    : Boolean.FALSE)
                     || 
loanTermVariations.getTermApplicableFrom().after(actualDisbursementDate.toDate()))
 {
                 iterator.remove();
             }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java
index 737f5a6..d9036b9 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanDisbursementDetails.java
@@ -72,7 +72,8 @@ public class LoanDisbursementDetails extends 
AbstractPersistableCustom {
         }
         final LoanDisbursementDetails loanDisbursementDetails = 
(LoanDisbursementDetails) obj;
         if (loanDisbursementDetails.principal.equals(this.principal)
-                && 
loanDisbursementDetails.expectedDisbursementDate.equals(this.expectedDisbursementDate))
 {
+                && 
loanDisbursementDetails.expectedDisbursementDate.compareTo(this.expectedDisbursementDate)
 == 0 ? Boolean.TRUE
+                        : Boolean.FALSE) {
             return true;
         }
         return false;
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java
index 76364a6..9a9f0d7 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountCharge.java
@@ -706,13 +706,17 @@ public class SavingsAccountCharge extends 
AbstractPersistableCustom {
         return Objects.equals(penaltyCharge, that.penaltyCharge) && 
Objects.equals(paid, that.paid) && Objects.equals(waived, that.waived)
                 && Objects.equals(status, that.status) && 
Objects.equals(savingsAccount, that.savingsAccount)
                 && Objects.equals(charge, that.charge) && 
Objects.equals(chargeTime, that.chargeTime)
-                && Objects.equals(dueDate, that.dueDate) && 
Objects.equals(feeOnMonth, that.feeOnMonth)
-                && Objects.equals(feeOnDay, that.feeOnDay) && 
Objects.equals(feeInterval, that.feeInterval)
-                && Objects.equals(chargeCalculation, that.chargeCalculation) 
&& Objects.equals(percentage, that.percentage)
-                && Objects.equals(amountPercentageAppliedTo, 
that.amountPercentageAppliedTo) && Objects.equals(amount, that.amount)
-                && Objects.equals(amountPaid, that.amountPaid) && 
Objects.equals(amountWaived, that.amountWaived)
-                && Objects.equals(amountWrittenOff, that.amountWrittenOff) && 
Objects.equals(amountOutstanding, that.amountOutstanding)
-                && Objects.equals(inactivationDate, that.inactivationDate);
+                && dueDate.compareTo(that.dueDate) == 0
+                        ? Boolean.TRUE
+                        : Boolean.FALSE && Objects.equals(feeOnMonth, 
that.feeOnMonth) && Objects.equals(feeOnDay, that.feeOnDay)
+                                && Objects.equals(feeInterval, 
that.feeInterval)
+                                && Objects.equals(chargeCalculation, 
that.chargeCalculation) && Objects.equals(percentage, that.percentage)
+                                && Objects.equals(amountPercentageAppliedTo, 
that.amountPercentageAppliedTo)
+                                && Objects.equals(amount, that.amount) && 
Objects.equals(amountPaid, that.amountPaid)
+                                && Objects.equals(amountWaived, 
that.amountWaived)
+                                && Objects.equals(amountWrittenOff, 
that.amountWrittenOff)
+                                && Objects.equals(amountOutstanding, 
that.amountOutstanding)
+                                && 
inactivationDate.compareTo(that.inactivationDate) == 0 ? Boolean.TRUE : 
Boolean.FALSE;
     }
 
     @Override
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java
index 443ea5d..f85dcd2 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareaccounts/domain/ShareAccount.java
@@ -215,7 +215,7 @@ public class ShareAccount extends AbstractPersistableCustom 
{
 
     public boolean setSubmittedDate(final Date submittedDate) {
         boolean toReturn = false;
-        if (!this.submittedDate.equals(submittedDate)) {
+        if (this.submittedDate.compareTo(submittedDate) == 0 ? Boolean.FALSE : 
Boolean.TRUE) {
             this.submittedDate = submittedDate;
             toReturn = true;
         }
@@ -224,7 +224,7 @@ public class ShareAccount extends AbstractPersistableCustom 
{
 
     public boolean setApprovedDate(final Date approvedDate) {
         boolean toReturn = false;
-        if (!this.approvedDate.equals(approvedDate)) {
+        if (this.approvedDate.compareTo(approvedDate) == 0 ? Boolean.FALSE : 
Boolean.TRUE) {
             this.approvedDate = approvedDate;
             toReturn = true;
         }
@@ -520,10 +520,11 @@ public class ShareAccount extends 
AbstractPersistableCustom {
     public ShareAccountTransaction getShareAccountTransaction(final 
ShareAccountTransaction transaction) {
         ShareAccountTransaction returnTrans = null;
         for (ShareAccountTransaction tran : this.shareAccountTransactions) {
-            if (tran.getPurchasedDate().equals(transaction.getPurchasedDate()) 
&& tran.getTotalShares().equals(transaction.getTotalShares())
-                    && 
tran.getPurchasePrice().compareTo(transaction.getPurchasePrice()) == 0 ? 
Boolean.TRUE
-                            : Boolean.FALSE && 
tran.getTransactionStatus().equals(transaction.getTransactionStatus())
-                                    && 
tran.getTransactionType().equals(transaction.getTransactionType())) {
+            if 
(tran.getPurchasedDate().compareTo(transaction.getPurchasedDate()) == 0 ? 
Boolean.TRUE
+                    : Boolean.FALSE && 
tran.getTotalShares().equals(transaction.getTotalShares())
+                            && 
tran.getPurchasePrice().compareTo(transaction.getPurchasePrice()) == 0 ? 
Boolean.TRUE
+                                    : Boolean.FALSE && 
tran.getTransactionStatus().equals(transaction.getTransactionStatus())
+                                            && 
tran.getTransactionType().equals(transaction.getTransactionType())) {
                 returnTrans = tran;
                 break;
             }
diff --git 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java
 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java
index 7334ff5..23aa8c8 100644
--- 
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java
+++ 
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/shareproducts/domain/ShareProduct.java
@@ -407,7 +407,7 @@ public class ShareProduct extends AbstractAuditableCustom {
         if (this.marketPrice != null && !this.marketPrice.isEmpty()) {
             for (ShareProductMarketPrice data : this.marketPrice) {
                 Date futureDate = data.getStartDate();
-                if (currentDate.equals(futureDate) || 
currentDate.after(futureDate)) {
+                if (currentDate.compareTo(futureDate) == 0 ? Boolean.TRUE : 
Boolean.FALSE || currentDate.after(futureDate)) {
                     marketValue = data.getPrice();
                 }
             }

Reply via email to