Bug 6566 - BundleSupport doesn't find a valid matching bundle
Summary: BundleSupport doesn't find a valid matching bundle
Status: CLOSED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: All All
: P3 blocker (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-20 01:51 UTC by Hans Bergsten
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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())))