harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Fedotov <alexei.fedo...@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:52:19 GMT
Kevin,
Is there any reason for Harmony to behave differently from RI?

> HY fails to throw NullPointException while RI works smoothly
Just trying to check my understanding. Does RI smoothly throw NPE?

Thanks.

On Mon, Apr 13, 2009 at 12:47 PM, Kevin Zhou <zhoukevin83@gmail.com> wrote:
>> 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?
>



-- 
With best regards / с наилучшими пожеланиями,
Alexei Fedotov / Алексей Федотов,
http://www.telecom-express.ru/
http://people.apache.org/~aaf/
http://harmony.apache.org/
http://code.google.com/p/openmeetings/

Mime
View raw message