harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Zhou <zhoukevi...@gmail.com>
Subject Re: [jira] Commented: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null
Date Mon, 13 Apr 2009 08:47:43 GMT
> In addition to the above defect, the constructors of MemoryNotificationInfo
> class behave differently from RI.
> For instance, given another test case [1], HY fails to throw
> NullPointException while RI works smoothly.
>
> For test_Constructor_NullPoolName_NullUsage test scenario:
> RI throws NPE as: java.lang.NullPointerException: Null poolName
>
> For test_Constructor_NullUsage test scenario:
> RI throws NPE as: java.lang.NullPointerException: Null usage
>
> [1] Test Case:
> public void test_Constructor_NullPoolName_NullUsage() {
>    try {
>        new MemoryNotificationInfo((String) null, (MemoryUsage) null,
>            -4294901761L);
>        fail("should throw NullPointerException");
>    } catch (NullPointerException e) {
>        // Expected
>    }
> }
>
> public void test_Constructor_NullUsage() {
>    try {
>        new MemoryNotificationInfo("poolName", (MemoryUsage) null,
>            -4294901761L);
>        fail("should throw NullPointerException");
>    } catch (NullPointerException e) {
>        // Expected
>    }
> }
>
Shall we follow RI from this behavior?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message