Bug 6566

Summary: BundleSupport doesn't find a valid matching bundle
Product: Taglibs Reporter: Hans Bergsten <hans>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: CLOSED FIXED    
Severity: blocker    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Hans Bergsten 2002-02-20 01:51:15 UTC
There's a bug in the BundleSupport.getBundle(String basename, Locale pref)
method, where it tests if the available Locale has a country code. The
current code performs the test like this:

  if (pref.getLanguage().equals(avail.getLanguage())
    && (avail.getCountry() == null)) 

But Locale.getCountry() never returns null; it returns the empty string if
no country is specified. Changing the test like this solves the problem:

  if (pref.getLanguage().equals(avail.getLanguage())
    && ("".equals(avail.getCountry())))