You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Timothee Maret (JIRA)" <ji...@apache.org> on 2016/12/22 08:02:58 UTC

[jira] [Closed] (SLING-6185) I18NHttpServletRequest#getLocale should never return null

     [ https://issues.apache.org/jira/browse/SLING-6185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothee Maret closed SLING-6185.
---------------------------------

> 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
>             Fix For: i18n 2.5.6
>
>         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)