Skip to content

FINERACT-2437: Decrease compilation warnings#5721

Open
rhopman wants to merge 1 commit intoapache:developfrom
symbaglobal:FINERACT-2437-decrease-compilation-warnings
Open

FINERACT-2437: Decrease compilation warnings#5721
rhopman wants to merge 1 commit intoapache:developfrom
symbaglobal:FINERACT-2437-decrease-compilation-warnings

Conversation

@rhopman
Copy link
Copy Markdown
Contributor

@rhopman rhopman commented Mar 30, 2026

Replace deprecated method calls with their modern equivalents across several modules:

  • ObjectUtils.defaultIfNull (deprecated in Commons Lang 3.15) → Objects.requireNonNullElse in 8 files across fineract-charge, fineract-core, fineract-loan, fineract-provider, and fineract-progressive-loan
  • RandomStringUtils.randomAlphabetic (static call on instance) → nextAlphabetic in DefaultContentPathRandomizer
  • StopWatch.getStartTime (deprecated in Commons Lang 3.12) → getStartInstant().toEpochMilli() in PlatformRequestLog
  • @Schema(required = true) (deprecated in Swagger 2.2) → @Schema(requiredMode = Schema.RequiredMode.REQUIRED) in AuthenticationApiResourceSwagger
  • PaymentTypeRepositoryWrapper (marked @Deprecated(forRemoval = true)) → replaced with direct PaymentTypeRepository usage in PaymentDetailAssembler, PaymentDetailWritePlatformServiceJpaRepositoryImpl, and PaymentDetailConfiguration

No behavioural changes.

Checklist

  • Write the commit message as per our guidelines
  • 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 our 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
  • 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.

@Override
public Integer fetchCurrentVersionNumber(Long loanId) {
final String sql = "select MAX(lrs.version) from m_loan_repayment_schedule_history lrs where lrs.loan_id = ?";
Integer max = this.jdbcTemplate.queryForObject(sql, new Object[] { loanId }, Integer.class);
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.

The jdbcTemplate.queryForObject(String, Object[], Class) method call is also deprecated (since Spring 5.3). If we are removing @SuppressWarnings("deprecation") ,please consider addressing that aswell!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, @DeathGun44. I have changed it now to the new varargs form.

Copy link
Copy Markdown
Contributor

@Aman-Mittal Aman-Mittal left a comment

Choose a reason for hiding this comment

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

Seems ok, While i also support Krishna's suggestion too.

@adamsaghy i think it is ready for review

@rhopman rhopman force-pushed the FINERACT-2437-decrease-compilation-warnings branch from 99d190b to 7d19ff3 Compare April 1, 2026 07:09
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