JDK-4152412 : NLS: JAVA GETISO3COUNTRY METHOD FAILS
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt:i18n
  • Affected Version: 1.1.6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-06-25
  • Updated: 1998-08-14
  • Resolved: 1998-08-14
Related Reports
Duplicate :  
Description

Name: clC74495			Date: 06/25/98


This is from Oracle, a Java licensee. 
The Oracle bug number is 676324.   
   
This bug did occur with 1.1.6.  Please consider this a  regression problem, and examine it ASAP.

To reproduce this problem, compile the following program with javac and run it
with appletviewer.
import java.applet.Applet;
import java.awt.Graphics;
import java.util.Locale;
import java.lang.System;
public class JavaLocTester extends Applet
{
  public void paint(Graphics g)
  {
    Locale myLocale = Locale.getDefault();
    g.drawString("Language: "+ myLocale.getLanguage(), 50, 20);
    g.drawString("Country: "+ myLocale.getCountry(), 50, 40);
    g.drawString("Variant: "+ myLocale.getVariant(), 50, 60);
    g.drawString("toString: "+ myLocale.toString(), 50, 80);
    g.drawString("Display Language: "+ myLocale.getDisplayLanguage(), 50, 120);
    g.drawString("Display Country: "+ myLocale.getDisplayCountry(), 50, 140);
    g.drawString("Display Variant: "+ myLocale.getDisplayVariant(), 50, 160);
    g.drawString("ISO3 Language: "+ myLocale.getISO3Language(), 50, 200);
    g.drawString("ISO3 Country: "+ myLocale.getISO3Country(), 50, 220);
  }
}

When run this program will produce the following java error output in the
MS DOSBOX.

Exception occurred during event dispatching:
java.util.MissingResourceException: Requested resource bundle not installed
        at java.lang.Throwable.<init>(Compiled Code)
        at java.util.MissingResourceException.<init>(Compiled Code)
        at java.util.Locale.getISO2Country(Locale.java:430)
        at java.util.Locale.getISO3Country(Locale.java:388)
        at JavaLocTester.paint(JavaLocTester.java:19)
        at sun.awt.windows.WComponentPeer.handleEvent(Compiled Code)
        at java.awt.Component.dispatchEventImpl(Compiled Code)
        at java.awt.Container.dispatchEventImpl(Compiled Code)
        at java.awt.EventDispatchThread.run(Compiled Code)
Exception occurred during event dispatching:
java.util.MissingResourceException: Requested resource bundle not installed
        at java.lang.Throwable.<init>(Compiled Code)
        at java.util.Locale.getISO2Country(Compiled Code)
        at JavaLocTester.paint(Compiled Code)
        at sun.awt.windows.WComponentPeer.handleEvent(Compiled Code)
        at java.awt.Component.dispatchEventImpl(Compiled Code)
        at java.awt.Container.dispatchEventImpl(Compiled Code)
        at java.awt.EventDispatchThread.run(Compiled Code)

For some reason this bug fails for the same languages as Oracle bug 675746(Javasoft bug: 4151938).
These bugs may be related.  The languages that fail (from bug 675746) are:
Albanian
Arabic (all)
Bulgarian
Croatian
Czech
English (Belize)
English (Caribbean)
English (Jamaica)
English (South Africa)
English (Trinidad)
Estonian
Korean
Latvian
Lithuanian
Romanian
Slovak
Slovenian
Spanish (all other than Mexico, Modern Sort, and Traditional Sort)
Swedish (Finland)
Failure may also be found in the following languages:
French (Luxembourg)
German (Lichtenstien)
German (Luxembourg)
Vietnamese
(Review ID: 34235)
======================================================================

Comments
EVALUATION This bug, as the reporter suspects, has the same underlying cause as #4151938. In both cases, the symptoms the reporter is seeing are happening because the JDK is not picking up the default country code correctly from the OS. All APIs on Locale that depend on the country code will return bogus results. Since this bug and #4151938 have the same underlying cause, I'm closing this bug as a duplicate of that one. Also, some of the locales the reporter says produce the wrong result do so because they aren't supported in 1.1. Handling this for getISO3Country and getISO3Language was requested by bug #4118595, which was fixed in 1.2. This change could also be backported into 1.1 if necessary. richard.gillam@eng 1998-08-13
13-08-1998