FINERACT-2538: Fix String Locale compiler warning in EnumValueValidator#5595
FINERACT-2538: Fix String Locale compiler warning in EnumValueValidator#5595hms2186 wants to merge 1 commit intoapache:developfrom
Conversation
|
@hms2186 Please rebase and fix the conflicts. |
cdf3ca0 to
720e507
Compare
720e507 to
6e09733
Compare
|
@adamsaghy I have rebased the branch, resolved all conflicts, and squashed the changes into a single commit. I've also created the Jira ticket FINERACT-2538 and updated the PR title accordingly. Ready for re-review |
6e09733 to
4bd69b5
Compare
|
@adamsaghy It looks like the CI pipeline finished, but E2E Tests (Shard 8) failed during the Loan/EMI calculation feature tests. Since my change is restricted to resolving a compiler warning in EnumValueValidator, this appears to be an environment timeout or a flaky test. Could you please re-trigger the failed job when you have a moment? |
| @@ -56,4 +56,5 @@ private static SpringApplicationBuilder configureApplication(SpringApplicationBu | |||
| public static void main(String[] args) throws IOException { | |||
| configureApplication(new SpringApplicationBuilder(ServerApplication.class)).run(args); | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
No need for the extra line
| @@ -30,12 +30,12 @@ public class EnumValueValidator implements ConstraintValidator<EnumValue, String | |||
|
|
|||
| @Override | |||
| public void initialize(EnumValue annotation) { | |||
| acceptedValues = Arrays.stream(annotation.enumClass().getEnumConstants()).map(e -> e.name().toLowerCase()) | |||
| acceptedValues = Arrays.stream(annotation.enumClass().getEnumConstants()).map(e -> e.name().toLowerCase(java.util.Locale.ROOT)) | |||
There was a problem hiding this comment.
Can you please make sure to check whether this is an issue with other classes? I think you can extend this story and cover all "missing" locale compilation warning in one shot. What do you think?
4bd69b5 to
cb640ea
Compare
|
@hms2186 Please rebase this PR. |
cb640ea to
377a62b
Compare
|
Hi @adamsaghy, I've completed the project-wide audit and successfully rebased the PR onto the latest develop branch, resolving the conflicts in the Note service implementation. I've patched multiple instances of .toLowerCase(), .toUpperCase(), and String.format() missing the Locale parameter across fineract-core, fineract-provider, and fineract-investor. I've used java.util.Locale.ROOT to ensure consistent, locale-neutral behavior. The updated, signed commit has been pushed |
|
|
Hi @adamsaghy, |
- Resolved String.toLowerCase() locale warnings across the codebase. - Updated Note service implementation to align with NoteUpdateRequest refactoring. Signed-off-by: Hemanth Madhav <216912024+hms2186@users.noreply.github.com>
fb296fe to
3f29427
Compare
|
Hi @l0hacker, I have squashed my changes into a single signed commit as requested and updated the Note service to use the new builder pattern. I'm seeing a failure in the build-core check, but looking at the logs, it appears to be a transient org.eclipse.swt dependency download error rather than a failure in my Java logic. Could you please trigger a re-run of the failed check when you have a moment? |
Description
Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
This PR resolves a [StringCaseLocaleUsage] compiler warning found in EnumValueValidator.java during the build process.
Calling String.toLowerCase() without specifying a Locale relies on the system's default locale, which can cause unexpected behavior on internationalized servers (such as the Turkish "I" issue).
Fix: Explicitly set Locale.ROOT on lines 33 and 39 to ensure consistent, locale-insensitive character mapping for the enum validation.
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.