harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (HARMONY-1759) [classlib][luni]Compatibility: ClassName of MissingResourceException thorwn in ResourceBundle.getBundle() methods does not contains Locale info
Date Mon, 09 Oct 2006 03:21:20 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1759?page=all ]

Nathan Beyer reassigned HARMONY-1759:
-------------------------------------

    Assignee: Nathan Beyer

> [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

        

Mime
View raw message