Description
HippoDocument#getLocale is using LocaleUtils#toLocale. This method throws an IllegalArgumentException when the locale is not null and invalid.
I encountered a problem when the folder locale was missing, and the documents created in this folder had the invalid locale 'document-type-locale'. It was breaking some pages on the website.
So I think it would be safer to catch and log this exception. My proposition:
public Locale getLocale() {
String localeString = getLocaleString();
try
catch(IllegalArgumentException e)
{ log.warn("Invalid locale " + localeString + " for document " + getPath(), e); } return null;
}