You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Nathan Beyer (JIRA)" <ji...@apache.org> on 2006/07/18 01:52:14 UTC
[jira] Assigned: (HARMONY-901) java.util.Locale(String language,
String country, String variant) constructor doesn't throw NPE when variant
is null
[ http://issues.apache.org/jira/browse/HARMONY-901?page=all ]
Nathan Beyer reassigned HARMONY-901:
------------------------------------
Assignee: Nathan Beyer
> java.util.Locale(String language, String country, String variant) constructor doesn't throw NPE when variant is null
> --------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-901
> URL: http://issues.apache.org/jira/browse/HARMONY-901
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Windows XP Professional
> Reporter: Anton Luht
> Assigned To: Nathan Beyer
> Priority: Minor
> Attachments: patch.txt
>
>
> VM + classlib revision 422694 msvc debug build
> Problem:
> java.util.Locale(String, String, String) does not throw NullPointerException when one of arguments is null.
> RI throws it.
> Java spec 1.5.0 says:
> "Throws:
> NullPointerException - thrown if any argument is null.
> ".
> import java.util.Locale;
> public class Test {
> public static void main(String args[]) {
> try {
> new Locale("aaa", "ccc", null);
> System.out.println("No Exception!");
> } catch (NullPointerException e) {
> System.out.println("Exception thrown "+e);
> e.printStackTrace();
> }
> }
> }
> Output in RI:
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> Exception thrown java.lang.NullPointerException
> java.lang.NullPointerException
> at java.util.Locale.<init>(Locale.java:247)
> at Test.main(test.java:6)
> Output in Harmony:
> No Exception!
> ---------
> The patch with JUnit test and classlib code modification that resolves this problem is attached
--
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