Hi everyone,
While working on FINERACT-3206, I encountered a NullPointerException in the
savings accounting flow. I investigated whether it was related to my
changes and reproduced the same failure on an unmodified upstream/develop
checkout at commit 0af182c14b.
The failure occurs in,
SavingsAccrualAccountingIntegrationTest.testBackdatedWithdrawalReversesAndReaccruesWithPivotDateConfiguration
The exception is,
java.lang.NullPointerException: Cannot invoke "java.lang.Long.toString()"
because the return value of "java.util.Map.get(Object)" is null
at AccountingProcessorHelperImpl.populateSavingsDtoFromMap(
AccountingProcessorHelperImpl.java:244
)
at JournalEntryWritePlatformServiceImpl.createJournalEntriesForSavings(
JournalEntryWritePlatformServiceImpl.java:456
)
The failing statement is,
final String transactionId = ((Long) map.get("id")).toString();
I traced the input back to
SavingsAccount.getSavingsAccountTransactionsWithPivotConfig(), where
transactions are converted into maps using
transaction.toMapData(currencyCode).
The accounting helper expects every transaction map to contain a non-null id,
but this assumption is violated in the failing execution.
So far, I have confirmed-
1. The failure reproduces on both my branch and unmodified upstream develop.
2. The issue is not currently due to changes made for FINERACT-3206.
3. The transaction lifecycle responsible for the null ID has not yet been
conclusively identified.
I wanted to ask whether this needs further investigation as a separate
issue, independent of FINERACT-3206. Is there any known behaviour in the
savings transaction persistence/accounting flow that could explain this? Would
you recommend completing the transaction lifecycle investigation and
raising a separate Jira issue?
I also need guidance regarding the current status of FINERACT-3206. I have
kept the PR in draft while investigating the test failure. Should I keep it
as a draft until this investigation is complete, or should I move it out of
draft and make it available for review, given that the NPE also reproduces
on unmodified upstream develop?
I haven't made any changes related to the NPE, and I want to ensure that
the two investigations remain separate.
Thanks,
Sanvi Abhijit Naik