ResourceBundle res; String pattern; try { res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", loc); pattern = res.getString("collation_rules"); } catch (MissingResourceException x) { return null; } try { return new RuleBasedCollator (pattern); } catch (ParseException x) { return null; }
return getInstance (Locale.getDefault());
  public static Collator getInstance (Locale loc)  {    ResourceBundle res;    String pattern;    try      {	res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation",				       loc);	pattern = res.getString("collation_rules");      }    catch (MissingResourceException x)      {	return null;      }    try      {	return new RuleBasedCollator (pattern);      }    catch (ParseException x)      {	return null;      }  }