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] Closed: (HARMONY-901) java.util.Locale(String language, String country, String variant) constructor doesn't throw NPE when variant is null
Date Fri, 21 Jul 2006 23:34:15 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-901?page=all ]

Nathan Beyer closed HARMONY-901.
--------------------------------


verified

> 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

        

Mime
View raw message