harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-703) [classlib][logging] java.util.logging.Level constructors should throw NPE if name == null
Date Fri, 30 Jun 2006 06:10:30 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-703?page=comments#action_12418576 ] 

Vladimir Ivanov commented on HARMONY-703:
-----------------------------------------

verified, thanks

> [classlib][logging] java.util.logging.Level constructors should throw NPE if name ==
null
> -----------------------------------------------------------------------------------------
>
>          Key: HARMONY-703
>          URL: http://issues.apache.org/jira/browse/HARMONY-703
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Vladimir Ivanov
>     Assignee: George Harley
>  Attachments: Level.patch, LevelTest.patch, LevelTest2.patch
>
> The j2se spec says for java.util.logging.Level constructors: "NPE- if the name is null"
but harmony doesn't throw it.
> =============== test.java ============================
> import java.util.logging.*;
> import java.io.*;
> public class test {
>         public static void main (String[] args) { 
>             try {
>                System.out.println("Should be NPE: " + new test().new MockLevel(null,
4));
>             } catch (NullPointerException e) {
>                System.out.println("OK");
>             }
>             try {
>                System.out.println("Should be NPE: " + new test().new MockLevel(null,
4, "str"));
>             } catch (NullPointerException e) {
>                System.out.println("OK");
>             }  
>         } 
>         public class MockLevel extends Level implements Serializable {
>             private static final long serialVersionUID = 1L;
>             public MockLevel(String name, int value) {
>                super(name, value);
>         }
>         public MockLevel(String name, int value, String resourceBundleName) {
>                super(name, value, resourceBundleName);
>         }
>     }
> }
> ==================================================
>  
> Output:
> C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -showversion test
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System
optimized over throughput (initial strategy singleparpar))
> OK
> OK
> C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe -showversion test
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> Should be NPE: null
> Should be NPE: null
> C:\tmp\tmp17>C:\harmony\drlvm\trunk\build\win_ia32_msvc_release\deploy\jre\bin\ij
-showversion test
> Apache Harmony DRLVM HEAD-4807 (2006-05-02), Windows/ia32/msvc 1310, release
> Should be NPE: null
> Should be NPE: null

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