question: public static Locale ensureLocale ( Object localeObject ) { if ( localeObject instanceof String ) { return parseLocale ( ( String ) localeObject ) ; } else if ( localeObject instanceof Locale ) { return ( Locale ) localeObject ; } return Locale . getDefault ( ) ; }
target:  The input can be a String, Locale, or even null and a valid Locale will always be returned; if nothing else works, returns the default locale.