Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

FINERACT-1266: NullPointerException at SavingsHelper.determineInterestPostingPeriods() - #5508

Merged
adamsaghy merged 5 commits into
apache:developfrom
Prakash-M-S:fix/FINERACT-1266-final
Feb 18, 2026
Merged

adamsaghy merged 5 commits into
apache:developfrom
Prakash-M-S:fix/FINERACT-1266-final

Conversation

@Prakash-M-S

Copy link
Copy Markdown
Contributor

Description

Fixed a NullPointerException that occurs when determineInterestPostingPeriods is called with a null SavingsPostingInterestPeriodType. This aligns the behavior with the existing null checks for startInterestCalculationLocalDate and interestPostingUpToDate.

Checklist

Please verify these are completed:

  • Code builds successfully
  • Added a Unit Test (SavingsHelperNPExceptionTest.java) to verify the fix
  • Commit is signed
  • Related to issue FINERACT-1266

Test Evidence

The new test SavingsHelperNPExceptionTest passes with the fix and fails without it.

@IOhacker

Copy link
Copy Markdown
Contributor

@Prakash-M-S squash and commit

@Prakash-M-S

Copy link
Copy Markdown
Contributor Author

@IOhacker
I would like to squash them, but I am currently facing a blocker: I used the GitHub Web Editor to commit these changes to ensure they were GPG Verified, as my local environment is not yet set up for signing.
If I squash them locally now, I will lose the signature and the build will fail again.

How would you advise I proceed? Would it be possible for you to use the "Squash and Merge" option on your end? Or would you prefer I pause to configure my local GPG setup first?

@adamsaghy

Copy link
Copy Markdown
Contributor
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':fineract-core:spotlessJavaCheck'.
> The following files had format violations:
      src/test/java/org/apache/fineract/portfolio/savings/domain/SavingsHelperNPExceptionTest.java
          @@ -23,11 +23,12 @@
           import·java.time.LocalDate;
           import·java.util.ArrayList;
           import·java.util.List;
          -import·org.apache.fineract.infrastructure.core.domain.LocalDateInterval;·//·Ensure·this·import·exists
          +import·org.apache.fineract.infrastructure.core.domain.LocalDateInterval;
           import·org.apache.fineract.portfolio.savings.SavingsPostingInterestPeriodType;
           import·org.junit.jupiter.api.Test;
           
           class·SavingsHelperNPExceptionTest·{
          +
           ····private·final·SavingsHelper·savingsHelper·=·new·SavingsHelper(null);

           
           ····@Test
          @@ -41,13 +42,8 @@
           ········Integer·financialYearBeginningMonth·=·1;
           ········List<LocalDate>·postInterestAsOn·=·new·ArrayList<>();
           
          -········List<LocalDateInterval>·result·=·savingsHelper.determineInterestPostingPeriods(
          -················start,
          -················end,
          -················nullPostingPeriodType,
          -················financialYearBeginningMonth,
          -················postInterestAsOn
          -········);
          +········List<LocalDateInterval>·result·=·savingsHelper.determineInterestPostingPeriods(start,·end,·nullPostingPeriodType,
          +················financialYearBeginningMonth,·postInterestAsOn);
           
           ········assertTrue(result.isEmpty(),·"Result·should·be·empty·when·postingPeriodType·is·null");
           ····}
  Run './gradlew :fineract-core:spotlessApply' to fix these violations.

@adamsaghy
adamsaghy merged commit 9ca717f into apache:develop Feb 18, 2026
37 checks passed
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