Skip to content

Fix for i18n for JDK22+ onwards#6651

Merged
LongyuZhang merged 2 commits intoadoptium:masterfrom
psawant19:i18njdk22
Oct 10, 2025
Merged

Fix for i18n for JDK22+ onwards#6651
LongyuZhang merged 2 commits intoadoptium:masterfrom
psawant19:i18njdk22

Conversation

@psawant19
Copy link
Copy Markdown
Contributor

@psawant19 psawant19 commented Oct 10, 2025

Month format is changed in Korean from M\uc6d4 to MMMM
in Chinese from 12 hr to 24 hr format -> ah:mm:ss to HH:mm:ss

Signed-off-by: Pratiksha Sawant Pratiksha.Sawant@ibm.com

Month format is changed from jdk22 onwards from M\uc6d4 to MMMM

Signed-off-by: Pratiksha Sawant <Pratiksha.Sawant@ibm.com>
@psawant19
Copy link
Copy Markdown
Contributor Author

@llxia Could you please review this PR.

Below are the grinder links for i18n tests on JDK25, all passed.

MBCS_Tests_i18n_ja_JP_linux: https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder_CR/46604/
MBCS_Tests_i18n_ko_KR_linux: https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder_CR/46612/
MBCS_Tests_i18n_zh_TW_linux: https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder_CR/46605/
MBCS_Tests_i18n_zh_CN_linux: https://hyc-runtimes-jenkins.swg-devops.com/job/Grinder_CR/46606/

resource = ResourceBundle.getBundle("ResourceBundleTest_19", locale);
} catch (MissingResourceException e) {} // Do nothing
}
}
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.

Can we reduce try-catch duplication and put the logic into a function?

private ResourceBundle tryGetBundle(String baseName, Locale locale) {
	try {
		return ResourceBundle.getBundle(baseName, locale);
	} catch (MissingResourceException e) {
		// Do nothing
		return null;
	}
}

Then use:

if (feature >= 22L) {
	resource = tryGetBundle("ResourceBundleTest_22", locale);
} else if (feature >= 19L) {
	resource = tryGetBundle("ResourceBundleTest_19", locale);
} else if (feature == 16L) {
	resource = tryGetBundle("ResourceBundleTest_16", locale);
}

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.

Done. Fixes are made as per the comment.

ResourceBundle

Signed-off-by: Pratiksha Sawant <Pratiksha.Sawant@ibm.com>
@llxia
Copy link
Copy Markdown
Contributor

llxia commented Oct 10, 2025

Thanks @psawant19, for fixing this. I noticed that MBCS_Tests_formatter_zh_TW_linux is also excluded due to eclipse-openj9/openj9#19083

<comment>https://github.com/eclipse-openj9/openj9/issues/19083</comment>

Unless we fix MBCS_Tests_formatter_zh_TW_linux, we cannot use the fixes git keyword - Fixes: eclipse-openj9/openj9/issues/19083. This will close eclipse-openj9/openj9#19083, which is not what we wanted. Please change Fixes to Related. Thanks

@psawant19
Copy link
Copy Markdown
Contributor Author

I have the fixes for MBCS_Tests_formatter_zh_TW_linux as well, but need to test once. Will create a separate PR once I complete testing.

@llxia llxia requested a review from LongyuZhang October 10, 2025 13:35
Copy link
Copy Markdown
Contributor

@LongyuZhang LongyuZhang left a comment

Choose a reason for hiding this comment

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

LGTM

@LongyuZhang LongyuZhang merged commit 5279a2d into adoptium:master Oct 10, 2025
3 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