You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tony Wu (JIRA)" <ji...@apache.org> on 2006/11/22 09:04:03 UTC

[jira] Updated: (HARMONY-2256) [classlib][luni]should throw NPE when put/get a null value to/from env map.

     [ http://issues.apache.org/jira/browse/HARMONY-2256?page=all ]

Tony Wu updated HARMONY-2256:
-----------------------------

    Description: 
The testcase below passed on RI but failed on Harmony. 

ProcessBuilder pb = new ProcessBuilder("Arg1", "Arg2", "Arg3");
        Map<String, String> env = pb.environment();
        try {
            env.put(null,"");
            fail("should throw NPE.");
        } catch (NullPointerException e) {
            // expected;
        }
        try {
            env.put("",null);
            fail("should throw NPE.");
        } catch (NullPointerException e) {
            // expected;
        }
        try {
            env.get(null);
            fail("should throw NPE.");
        } catch (NullPointerException e) {
            // expected;
        }

  was:
The testcase below passed on RI but failed on Harmony. 

ProcessBuilder pb = new ProcessBuilder("Arg1", "Arg2", "Arg3");
        Map<String, String> env = pb.environment();
        System.out.println(env.getClass());
        try {
            env.put(null,"");
            fail("should throw NPE.");
        } catch (NullPointerException e) {
            // expected;
        }
        try {
            env.put("",null);
            fail("should throw NPE.");
        } catch (NullPointerException e) {
            // expected;
        }
        try {
            env.get(null);
            fail("should throw NPE.");
        } catch (NullPointerException e) {
            // expected;
        }


> [classlib][luni]should throw NPE when put/get a null value to/from env map.
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-2256
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2256
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Tony Wu
>         Attachments: harmony-2256.diff
>
>
> The testcase below passed on RI but failed on Harmony. 
> ProcessBuilder pb = new ProcessBuilder("Arg1", "Arg2", "Arg3");
>         Map<String, String> env = pb.environment();
>         try {
>             env.put(null,"");
>             fail("should throw NPE.");
>         } catch (NullPointerException e) {
>             // expected;
>         }
>         try {
>             env.put("",null);
>             fail("should throw NPE.");
>         } catch (NullPointerException e) {
>             // expected;
>         }
>         try {
>             env.get(null);
>             fail("should throw NPE.");
>         } catch (NullPointerException e) {
>             // expected;
>         }

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