[ https://issues.apache.org/jira/browse/SLING-6185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Timothee Maret updated SLING-6185: ---------------------------------- Flags: Patch > I18NHttpServletRequest#getLocale should never return null > --------------------------------------------------------- > > Key: SLING-6185 > URL: https://issues.apache.org/jira/browse/SLING-6185 > Project: Sling > Issue Type: Bug > Components: i18n > Affects Versions: i18n 2.5.4 > Reporter: Timothee Maret > Assignee: Timothee Maret > Attachments: SLING-6185.patch > > > According to the JEE API, the {{ServletRequest#getLocale}} should never > return {{null}}, the ultimate fallback being the default locale for the > server. > However, the Sling wrapper > {{o.a.s.i.i.I18NFilter.I18NHttpServletRequest#getLocale}} _may_ return > {{null}} in case: > 1. the localeResolver does return {{empty list}} (allowed as per API) > 2. {{The bundleProvider#getDefaultLocale}} returns {{null}} (not clear if > allowed or not) > With the current Sling code, 2. can occurs at > https://github.com/apache/sling/blob/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/I18NFilter.java#L198 > [0] > https://github.com/apache/sling/blob/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/I18NFilter.java#L280-L283 -- This message was sent by Atlassian JIRA (v6.3.4#6332)