harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-1759) [classlib][luni]Compatibility: ClassName of MissingResourceException thorwn in ResourceBundle.getBundle() methods does not contains Locale info
Date Fri, 06 Oct 2006 14:29:20 GMT
[classlib][luni]Compatibility: ClassName of MissingResourceException thorwn in ResourceBundle.getBundle()
methods does not contains Locale info
-----------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1759
                 URL: http://issues.apache.org/jira/browse/HARMONY-1759
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Ilya Okomin
            Priority: Minor


According to J2SE API specifications of java.util.ResourceBundle class:
public static ResourceBundle getBundle(String baseName, Locale locale, ClassLoader loader)
public static ResourceBundle getBundle(String baseName, Locale)
public static ResourceBundle getBundle(String baseName)

Throws:
    MissingResourceException - if no resource bundle for the specified base 
                               name can be found

If the resource is absent then both RI and Harmony throw MissingResourceException.
RI creates MissingResourceException using name which contains information about baseName and
locale (or default locale).
But Harmony throws MissingResourceException which class name informs only about baseName and
does not mention used locale.
----------------test.java-------------------
import java.util.*;

public class test {
    
    public static void main(String[] args) {
        Locale locale = Locale.GERMAN;
        String nonExistentBundle = "Non-ExistentBundle";
        try {
            ResourceBundle.getBundle(nonExistentBundle, locale, new test().getClass()
                    .getClassLoader());
        } catch (MissingResourceException e) {
            System.out.println("3 params (Locale.GERMAN): e.getClassName() = " + e.getClassName());
        }
        
        try {
            ResourceBundle.getBundle(nonExistentBundle, locale);
        } catch (MissingResourceException e) {
            System.out.println("2 params (Locale.GERMAN): e.getClassName() = " + e.getClassName());
        }

        locale = Locale.getDefault();
        try {
            ResourceBundle.getBundle(nonExistentBundle);
        } catch (MissingResourceException e) {
            System.out.println("1 param : e.getClassName() = " + e.getClassName());
        }

    }
}
--------------------------------------
===== RI Output ======
3 params (Locale.GERMAN): e.getClassName() = Non-ExistentBundle_de
2 params (Locale.GERMAN): e.getClassName() = Non-ExistentBundle_de
1 param : e.getClassName() = Non-ExistentBundle_en_US

===== Harmony Output ======
3 params (Locale.GERMAN): e.getClassName() = Non-ExistentBundle
2 params (Locale.GERMAN): e.getClassName() = Non-ExistentBundle
1 param : e.getClassName() = Non-ExistentBundle


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message