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/06 16:29:20 UTC
[jira] Created: (HARMONY-1759) [classlib][luni]Compatibility:
ClassName of MissingResourceException thorwn in ResourceBundle.getBundle()
methods does not contains Locale info
[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
[jira] Updated: (HARMONY-1759) [classlib][luni]Compatibility:
ClassName of MissingResourceException thorwn in ResourceBundle.getBundle()
methods does not contains Locale info
Posted by "Ilya Okomin (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1759?page=all ]
Ilya Okomin updated HARMONY-1759:
---------------------------------
Attachment: Harmony-1759.patch
Patch
> [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
> 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
[jira] Resolved: (HARMONY-1759) [classlib][luni]Compatibility:
ClassName of MissingResourceException thorwn in ResourceBundle.getBundle()
methods does not contains Locale info
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1759?page=all ]
Nathan Beyer resolved HARMONY-1759.
-----------------------------------
Resolution: Fixed
Patch applied. Please verify that it was applied as expected. Thanks.
> [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
[jira] Assigned: (HARMONY-1759) [classlib][luni]Compatibility:
ClassName of MissingResourceException thorwn in ResourceBundle.getBundle()
methods does not contains Locale info
Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
[ 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
[jira] Commented: (HARMONY-1759) [classlib][luni]Compatibility:
ClassName of MissingResourceException thorwn in ResourceBundle.getBundle()
methods does not contains Locale info
Posted by "Ilya Okomin (JIRA)" <ji...@apache.org>.
[ 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
[jira] Updated: (HARMONY-1759) [classlib][luni]Compatibility:
ClassName of MissingResourceException thorwn in ResourceBundle.getBundle()
methods does not contains Locale info
Posted by "Ilya Okomin (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1759?page=all ]
Ilya Okomin updated HARMONY-1759:
---------------------------------
Attachment: Harmony-1759-test.patch
Unit test.
There are also changes for MissingResourceExceptionTest.test_getClassName test. Because existed test case wasn't compatible with RI.
> [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
> 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