fix(savings): interest posting reports no longer fail when a product names no payable or paid GL
Fineract Build & Cucumber tests (without E2E tests) / verify (main, build-core) (push) Waiting to run
Fineract Build & Cucumber tests (without E2E tests) / verify (main, cucumber) (push) Waiting to run
Fineract Build & Cucumber tests (without E2E tests) / verify (progressive-loan, build-progressive-loan) (push) Waiting to run
Fineract Docker Builds / build (false, docker-compose-postgresql.yml, postgresql) (push) Waiting to run
Fineract Docker Builds / build (true, docker-compose.yml, mariadb) (push) Waiting to run
Fineract Documentation build / build (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 1 of 10) (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 10 of 10) (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 2 of 10) (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 3 of 10) (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 4 of 10) (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 5 of 10) (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 6 of 10) (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 7 of 10) (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 8 of 10) (push) Waiting to run
Fineract E2E Tests / E2E Tests (Shard 9 of 10) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MariaDB / test (test-core-1) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MariaDB / test (test-core-2) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MariaDB / test (test-core-3) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MariaDB / test (test-core-4) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MariaDB / test (test-core-5) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MySQL / test (test-core-1) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MySQL / test (test-core-2) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MySQL / test (test-core-3) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MySQL / test (test-core-4) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - MySQL / test (test-core-5) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - PostgreSQL / test (test-core-1) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - PostgreSQL / test (test-core-2) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - PostgreSQL / test (test-core-3) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - PostgreSQL / test (test-core-4) (push) Waiting to run
Fineract Cargo & Unit- & Integration tests - PostgreSQL / test (test-core-5) (push) Waiting to run
Fineract Liquibase Only mode - PostgreSQL / test (push) Waiting to run
Fineract Messaging Smoke Tests / Smoke Test with ActiveMQ (push) Waiting to run
Fineract Messaging Smoke Tests / Smoke Test with Kafka (push) Waiting to run

A ternary mixing a long with a Long unboxed a null GL id and failed the whole report with a
NullPointerException. The values are boxed with Long.valueOf, so a product that names no
payable or paid GL (allowed) is read as null.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 18:51:38 +05:30
co-authored by Claude Sonnet 5.5
parent 7d9c5563a4
commit 22e4fa4b96
2 changed files with 11 additions and 4 deletions
@@ -223,10 +223,13 @@ public class SavingsPooledInterestPostingService {
final long runId = openRun(reportId, productId, officeId, cycleDate, lines.size()); final long runId = openRun(reportId, productId, officeId, cycleDate, lines.size());
final PostingGlAccounts current = resolvePostingGlAccounts(productId); final PostingGlAccounts current = resolvePostingGlAccounts(productId);
// Long.valueOf, not the bare long: a ternary mixing a long with a Long is a long, so a GL the product does not name
// (null, and allowed) was unboxed here and the whole report failed with a NullPointerException.
final Long payableGl = report.get("payable_gl_account_id") != null final Long payableGl = report.get("payable_gl_account_id") != null
? ((Number) report.get("payable_gl_account_id")).longValue() ? Long.valueOf(((Number) report.get("payable_gl_account_id")).longValue())
: current.payableGl(); : current.payableGl();
final Long paidGl = report.get("paid_gl_account_id") != null ? ((Number) report.get("paid_gl_account_id")).longValue() final Long paidGl = report.get("paid_gl_account_id") != null
? Long.valueOf(((Number) report.get("paid_gl_account_id")).longValue())
: current.paidGl(); : current.paidGl();
final String currency = (String) lines.get(0).get("currency_code"); final String currency = (String) lines.get(0).get("currency_code");
@@ -210,9 +210,13 @@ public class FixedDepositInterestPostingService {
final Long expenseGl = mappedGlAccount(productId, GL_INTEREST_ON_SAVINGS); final Long expenseGl = mappedGlAccount(productId, GL_INTEREST_ON_SAVINGS);
final Long controlGl = mappedGlAccount(productId, GL_SAVINGS_CONTROL); final Long controlGl = mappedGlAccount(productId, GL_SAVINGS_CONTROL);
final PostingGlAccounts current = resolvePostingGlAccounts(productId); final PostingGlAccounts current = resolvePostingGlAccounts(productId);
final Long payableGl = report.get("payable_gl_account_id") != null ? ((Number) report.get("payable_gl_account_id")).longValue() // Long.valueOf, not the bare long: a ternary mixing a long with a Long is a long, so a product that names no payable
// or paid GL (null, and allowed) was unboxed here and the whole report failed with a NullPointerException.
final Long payableGl = report.get("payable_gl_account_id") != null
? Long.valueOf(((Number) report.get("payable_gl_account_id")).longValue())
: current.payableGl(); : current.payableGl();
final Long paidGl = report.get("paid_gl_account_id") != null ? ((Number) report.get("paid_gl_account_id")).longValue() final Long paidGl = report.get("paid_gl_account_id") != null
? Long.valueOf(((Number) report.get("paid_gl_account_id")).longValue())
: current.paidGl(); : current.paidGl();
final String currency = (String) lines.get(0).get("currency_code"); final String currency = (String) lines.get(0).get("currency_code");