/[classpath]/gjdoc/src/gnu/classpath/tools/gjdoc/Main.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/gjdoc/Main.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.50 by julian, Mon Dec 20 21:27:52 2004 UTC revision 1.51 by julian, Wed Feb 2 21:19:44 2005 UTC
# Line 1446  public final class Main Line 1446  public final class Main
1446      return this.option_locale;      return this.option_locale;
1447    }    }
1448    
1449      /**
1450       *  Return the collator to use based on the specified -locale
1451       *  option. If no collator can be found for the given locale, a
1452       *  warning is emitted and the default collator is used instead.
1453       */
1454    public Collator getCollator()    public Collator getCollator()
1455    {    {
1456      if (null == this.collator) {      if (null == this.collator) {
1457        this.collator = Collator.getInstance(getLocale());        Locale locale = getLocale();
1458        this.collator.setStrength(Collator.SECONDARY);        this.collator = Collator.getInstance(locale);
1459          Locale defaultLocale = Locale.getDefault();
1460          if (null == this.collator
1461              && !defaultLocale.equals(locale)) {
1462            this.collator = Collator.getInstance(defaultLocale);
1463            if (null != this.collator) {
1464              reporter.printWarning("No collator found for locale "
1465                                    + locale.getDisplayName()
1466                                    + "; using collator for default locale "
1467                                    + defaultLocale.getDisplayName()
1468                                    + ".");
1469            }
1470            else {
1471              this.collator = Collator.getInstance();
1472              reporter.printWarning("No collator found for specified locale "
1473                                    + locale.getDisplayName()
1474                                    + " or default locale "
1475                                    + defaultLocale.getDisplayName()
1476                                    + ": using default collator.");
1477            }
1478          }
1479          if (null == this.collator) {
1480            this.collator = Collator.getInstance();
1481            reporter.printWarning("No collator found for locale "
1482                                  + locale.getDisplayName()
1483                                  + ": using default collator.");
1484          }
1485      }      }
1486      return this.collator;      return this.collator;
1487    }    }

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26