Skip to content

FINERACT-2510: Resolve compilation warnings in fineract-core#5554

Open
Ambika-Sony wants to merge 1 commit intoapache:developfrom
Ambika-Sony:FINERACT-2510-resolve-core-warnings
Open

FINERACT-2510: Resolve compilation warnings in fineract-core#5554
Ambika-Sony wants to merge 1 commit intoapache:developfrom
Ambika-Sony:FINERACT-2510-resolve-core-warnings

Conversation

@Ambika-Sony
Copy link
Copy Markdown
Contributor

@Ambika-Sony Ambika-Sony commented Feb 27, 2026

Description

The details regarding these changes are present on the associated Apache Fineract JIRA ticket.
Summary of work:
Resolved 45 compilation warnings in the fineract-core module,
Replaced deprecated ObjectUtils.defaultIfNull and Date(String) constructor.
Fixed unchecked casts and raw type usage in DataEnricherProcessor and InternalExternalEventService.
Verified the module now compiles cleanly with a "BUILD SUCCESSFUL" status.

  • [x ] Write the commit message as per our guidelines
  • [ x] 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.
  • [x ] Create/update unit or integration tests for verifying the changes made.
  • [ x] Follow our coding conventions.
  • [ x] 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
  • [ x] This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

@IOhacker
Copy link
Copy Markdown
Contributor

Please Squash & Commit

@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2510-resolve-core-warnings branch from 2c5a17e to 828a7e3 Compare February 27, 2026 18:40
@Ambika-Sony
Copy link
Copy Markdown
Contributor Author

Please Squash & Commit

did it

@airajena
Copy link
Copy Markdown
Contributor

airajena commented Mar 1, 2026

Please Squash & Commit

did it

@Ambika-Sony please run ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest as pre commit checks
Execution failed for task ':fineract-core:spotlessJavaCheck'.

[Incubating] Problems report is available at: file:///home/runner/work/fineract/fineract/build/reports/problems/problems-report.html

The following files had format violations:
src/main/java/org/apache/fineract/infrastructure/core/service/DataEnricherProcessor.java
@@ -34,7 +34,7 @@
········this.enhancers·=·enhancers.orElse(new·ArrayList<>());
····}

      -····@SuppressWarnings({"unchecked",·"rawtypes"})
      +····@SuppressWarnings({·"unchecked",·"rawtypes"·})
       ····public·<T>·T·enrich(T·source)·{
       ········for·(DataEnricher·enhancer·:·enhancers)·{
       ············if·(enhancer.isDataTypeSupported(source.getClass()))·{

Run './gradlew :fineract-core:spotlessApply' to fix these violations.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org./`
`

@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2510-resolve-core-warnings branch 2 times, most recently from a4b3cbd to 1d8a135 Compare March 1, 2026 11:01
@Ambika-Sony
Copy link
Copy Markdown
Contributor Author

Please Squash & Commit

did it

@Ambika-Sony please run ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest as pre commit checks Execution failed for task ':fineract-core:spotlessJavaCheck'.

[Incubating] Problems report is available at: file:///home/runner/work/fineract/fineract/build/reports/problems/problems-report.html

The following files had format violations:
src/main/java/org/apache/fineract/infrastructure/core/service/DataEnricherProcessor.java
@@ -34,7 +34,7 @@
········this.enhancers·=·enhancers.orElse(new·ArrayList<>());
····}

      -····@SuppressWarnings({"unchecked",·"rawtypes"})
      +····@SuppressWarnings({·"unchecked",·"rawtypes"·})
       ····public·<T>·T·enrich(T·source)·{
       ········for·(DataEnricher·enhancer·:·enhancers)·{
       ············if·(enhancer.isDataTypeSupported(source.getClass()))·{

Run './gradlew :fineract-core:spotlessApply' to fix these violations.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Get more help at [https://help.gradle.org./](https://help.gradle.org./%60)

I'v successfully run spotlessApply, spotbugs, and checkstyle locally as requested, and the build is passing. Thank you for the guidance.

@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2510-resolve-core-warnings branch 3 times, most recently from 9fe492a to adede23 Compare March 8, 2026 16:16
@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2510-resolve-core-warnings branch from adede23 to 8e36464 Compare March 9, 2026 13:31
@adamsaghy
Copy link
Copy Markdown
Contributor

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':integration-tests:spotlessJavaCheck'.
> The following files had format violations:
      src/test/java/org/apache/fineract/integrationtests/SavingsAccountsExternalIdTest.java
          @@ -20,7 +20,6 @@
           
           import·static·org.assertj.core.api.Assertions.assertThat;
           
          -import·java.math.BigDecimal;
           import·java.time.format.DateTimeFormatter;
           import·java.util.UUID;
           import·org.apache.fineract.client.models.DeleteSavingsAccountsAccountIdResponse;
          @@ -78,7 +77,8 @@
           ········PutSavingsAccountsAccountIdRequest·request·=·new·PutSavingsAccountsAccountIdRequest();
           ········request.setLocale(locale);
           ········request.setNominalAnnualInterestRate(5.999);
          -········Response<PutSavingsAccountsAccountIdResponse>·response·=·okR(fineractClient().savingsAccounts.updateSavingsAccount(EXTERNAL_ID,·request,·""));
          +········Response<PutSavingsAccountsAccountIdResponse>·response·=·okR(

[Incubating] Problems report is available at: file:///home/runner/work/fineract/fineract/build/reports/problems/problems-report.html
          +················fineractClient().savingsAccounts.updateSavingsAccount(EXTERNAL_ID,·request,·""));
           
           ········assertThat(response.isSuccessful()).isTrue();
           ····}
          @@ -101,7 +101,8 @@
           ····@Order(4)
           ····void·retrieveSavingsAccountWithExternalId()·{
           ········LOG.info("------------------------------·RETRIEVING·SAVINGS·ACCOUNT·---------------------------------------");
          -········Response<SavingsAccountData>·response·=·okR(fineractClient().savingsAccounts.retrieveSavingsAccount(EXTERNAL_ID,·false,·null,·"all"));
          +········Response<SavingsAccountData>·response·=·okR(
          +················fineractClient().savingsAccounts.retrieveSavingsAccount(EXTERNAL_ID,·false,·null,·"all"));
           
           ········assertThat(response.isSuccessful()).isTrue();
           ········assertThat(response.body().getStatus().getCode()).isEqualTo("savingsAccountStatusType.approved");
          @@ -122,7 +123,8 @@
           ····@Order(6)
           ····void·retrieveSavingsAccountWithExternalIdSecondTime()·{
           ········LOG.info("------------------------------·RETRIEVING·SAVINGS·ACCOUNT·-·SECOND·TIME·---------------------------------------");
          -········Response<SavingsAccountData>·response·=·okR(fineractClient().savingsAccounts.retrieveSavingsAccount(EXTERNAL_ID,·false,·null,·"all"));
          +········Response<SavingsAccountData>·response·=·okR(
          +················fineractClient().savingsAccounts.retrieveSavingsAccount(EXTERNAL_ID,·false,·null,·"all"));
           
           ········assertThat(response.isSuccessful()).isTrue();
           ········assertThat(response.body().getStatus().getCode()).isEqualTo("savingsAccountStatusType.submitted.and.pending.approval");
          @@ -146,4 +148,4 @@
           
           ········assertThat(response.raw().code()).isEqualTo(404);
           ····}
          -}
          +}
  Run './gradlew :integration-tests:spotlessApply' to fix these violations.

@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2510-resolve-core-warnings branch from 8e36464 to d93b7f6 Compare March 20, 2026 16:44
};
}

@SuppressWarnings("deprecation")
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.

Please remove the suppression... that is not fixing anything but hiding...

this.enhancers = enhancers.orElse(new ArrayList<>());
}

@SuppressWarnings({ "unchecked", "rawtypes" })
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.

Please remove the suppression... that is not fixing anything but hiding...

var payLoad = method.invoke(null, byteBuffer);
if (externalEvent.getType().equalsIgnoreCase("BulkBusinessEvent")) {
var methodToGetDatas = payLoad.getClass().getMethod("getDatas", (Class<?>) null);
@SuppressWarnings("unchecked")
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.

Please remove the suppression... that is not fixing anything but hiding...

@adamsaghy
Copy link
Copy Markdown
Contributor

@Ambika-Sony Gentle reminder.

…re test compatibility

git rebase --continue

Resolve compilation warnings in fineract-core and ensure test compatibility
@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2510-resolve-core-warnings branch from 1faf66b to a68f1ee Compare April 2, 2026 13:58
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.

4 participants