[ https://issues.apache.org/jira/browse/LANG-1741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory updated LANG-1741: ---------------------------------- Summary: LocaleUtils.toLocale(String) cannot parse four segments (was: LocaleUtils.toLocale cannot parse four segments) > LocaleUtils.toLocale(String) cannot parse four segments > -------------------------------------------------------- > > Key: LANG-1741 > URL: https://issues.apache.org/jira/browse/LANG-1741 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Affects Versions: 3.14.0 > Environment: jdk18 > Reporter: Wang Hailong > Priority: Major > > the Locale construct method can handle it while the LocaleUtils.toLocale can > not > the test code is > {color:#bbb529}@Test > {color}{color:#cc7832}public void > {color}{color:#ffc66d}testLocaleUtilsToLocaleWithFourSegments{color}() { > String localeStr = {color:#6a8759}"en_001_US_POSIX"{color}{color:#cc7832}; > {color}{color:#cc7832} {color}Locale expectedLocale = {color:#cc7832}new > {color}Locale({color:#6a8759}"en"{color}{color:#cc7832}, > {color}{color:#6a8759}"001"{color}{color:#cc7832}, > {color}{color:#6a8759}"US_POSIX"{color}){color:#cc7832}; > {color}{color:#cc7832} {color}Locale actualLocale = > LocaleUtils.toLocale(localeStr){color:#cc7832}; > {color}{color:#cc7832} {color}assertEquals(expectedLocale{color:#cc7832}, > {color}actualLocale){color:#cc7832}; > {color}} -- This message was sent by Atlassian Jira (v8.20.10#820010)