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();
}

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 ( ) ; }
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 .
