harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou (JIRA)" <j...@apache.org>
Subject [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:42:14 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698344#action_12698344
] 

Kevin Zhou commented on HARMONY-6148:
-------------------------------------

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

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData
cd) should return null if the argument is null
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6148
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6148
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>             Fix For: 5.0M9
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case [1], RI passes while HY fails.
> The Java Spec specifies that it should return a MemoryNotificationInfo object represented
by cd if cd is not null; otherwise return null.
> [1] Test Case:
> public void test_from_NullCompositeData() {
>     assertNull(MemoryNotificationInfo.from(null));
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message