-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug
Milestone
Description
John Olmstead opened SPR-11806 and commented
The StringUtils.parseLocaleString method fails to correctly parse the variant if the variant contains the same characters as the country code. This is due to the fact that the lastIndexOf the country code is used as the dividing point instead of the first indexOf.
Here is the test to add to org.springframework.util.StringUtilsTest:
public void testParseLocaleWithVarientContainingCountryCode() throws Exception {
final String variant = "GBtest";
final String localeString = "en_GB_" + variant;
Locale locale = StringUtils.parseLocaleString(localeString);
assertEquals("Variant containing country code not extracted correctly.", variant, locale.getVariant());
}
Affects: 3.2.8, 4.0.4
Backported to: 3.2.9
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchestype: bugA general bugA general bug