Skip to content

FINERACT-2326: Improve null-safety - #4944

Merged
adamsaghy merged 1 commit into
apache:developfrom
adamsaghy:FINERACT-2326/null-safety
Aug 13, 2025
Merged

FINERACT-2326: Improve null-safety#4944
adamsaghy merged 1 commit into
apache:developfrom
adamsaghy:FINERACT-2326/null-safety

Conversation

@adamsaghy

@adamsaghy adamsaghy commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

Description

As part of this PR, my intention was to achieve proper null safety in the InterestPeriod, RepaymentPeriod and ProgressiveEmiCalculator classes:

  • Make sure no operation made on fields which value might be null!
  • Make sure to use null-safe arithmetic operations (like MathUtil)
  • Make sure for BigDecimal and Money operations to always provide the proper MathContext
  • Whenever we need a "zero" value Money object, use a simple, generic way to create this object.
    I have also modified the MathUtil class and added a new "nullToZero" method which accepts MathContext as parameter and set on the Money object!

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per https://github.com/apache/fineract/#pull-requests
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)

FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.

@adamsaghy
adamsaghy force-pushed the FINERACT-2326/null-safety branch from 69e98aa to 34028a0 Compare August 12, 2025 17:49

@somasorosdpc somasorosdpc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adamsaghy
adamsaghy force-pushed the FINERACT-2326/null-safety branch from 34028a0 to 1f17aed Compare August 13, 2025 08:19
@adamsaghy
adamsaghy merged commit c2519c7 into apache:develop Aug 13, 2025
39 checks passed
@adamsaghy
adamsaghy deleted the FINERACT-2326/null-safety branch April 23, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants