Repository navigation
FINERACT-1266: Fix potential NPE in determineInterestPostingPeriods - #5454
Conversation
|
This PR fixes one of the potential NPE scenarios related to FINERACT-932. |
|
@Satish11012007 , please sign your commit and also fix the PR title. |
|
@Satish11012007 Please rebase this PR with latest develop branch! Also it seems licence headers are missing from the newly created files: |
|
@Satish11012007 please squash your commits into one commit and also please sign your commit. |
|
|
||
| private static final CompoundInterestHelper COMPOUND_INTEREST_HELPER = new CompoundInterestHelper(); | ||
|
|
||
| // FIXED METHOD (FINERACT-1266) |
There was a problem hiding this comment.
Please remove the AI generated, useless comments!
| return postingPeriods; | ||
| } | ||
|
|
||
| // 🔐 Null-safe list |
There was a problem hiding this comment.
Please remove the AI generated, useless comments!
| postInterestAsOn = Collections.emptyList(); | ||
| } | ||
|
|
||
| // 🔐 Null-safe posting period |
There was a problem hiding this comment.
Please remove the AI generated, useless comments!
| private LocalDate determineInterestPostingPeriodEndDateFrom(final LocalDate periodStartDate, | ||
| final SavingsPostingInterestPeriodType interestPostingPeriodType, final LocalDate interestPostingUpToDate, | ||
|
|
||
| // FIXED HELPER METHOD |
There was a problem hiding this comment.
Please remove the AI generated, useless comments!
| final LocalDate interestPostingUpToDate, | ||
| Integer financialYearBeginningMonth) { | ||
|
|
||
| // 🔐 Null-safe fallback |
There was a problem hiding this comment.
Please remove the AI generated, useless comments!
There was a problem hiding this comment.
What did you change here?
|
@Satish11012007 Please squash your commits and make sure the commit message is correct. THe 1st commit message are missing the : after the |
| } | ||
|
|
||
| if (!isEndDateSet) { | ||
| periodEndDate = quarterlyDates.get(0).plusYears(1).with(TemporalAdjusters.lastDayOfMonth()); |
There was a problem hiding this comment.
why did you removed this?
| } | ||
|
|
||
| if (!isEndDateSet) { | ||
| periodEndDate = biannualDates.get(0).plusYears(1).with(TemporalAdjusters.lastDayOfMonth()); |
There was a problem hiding this comment.
why did you removed this?
adamsaghy
left a comment
There was a problem hiding this comment.
Kindly see my concerns!
5b5d615 to
86fcfe4
Compare
86fcfe4 to
b982c6f
Compare
Description:
This PR addresses a potential NullPointerException in
determineInterestPostingPeriods by adding null-safety checks
for edge cases where inputs may be absent. The change improves
stability without affecting existing logic.
Key Changes:
Testing:
Checklist: