You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ilya Okomin (JIRA)" <ji...@apache.org> on 2006/10/12 11:53:38 UTC

[jira] Commented: (HARMONY-1759) [classlib][luni]Compatibility: ClassName of MissingResourceException thorwn in ResourceBundle.getBundle() methods does not contains Locale info

    [ http://issues.apache.org/jira/browse/HARMONY-1759?page=comments#action_12441683 ] 
            
Ilya Okomin commented on HARMONY-1759:
--------------------------------------

Nathan, thanks!
Patches were applied as expected.

> [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
>         Assigned To: Nathan Beyer
>            Priority: Minor
>         Attachments: Harmony-1759-test.patch, Harmony-1759.patch
>
>
> 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