You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Kevin Zhou (JIRA)" <ji...@apache.org> on 2009/04/13 10:35:14 UTC

[jira] Created: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

[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


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.


Re: [jira] Commented: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by Alexei Fedotov <al...@gmail.com>.
Kevin, is there any problem to make the behavior compatible?

On Mon, Apr 13, 2009 at 12:59 PM, Kevin Zhou <zh...@gmail.com> wrote:
>>
>> >Is there any reason for Harmony to behave differently from RI?
>
> I don't think that there is any specific reason why HY behaves differently
> from RI.
>
>
>> >Just trying to check my understanding. Does RI smoothly throw NPE?
>
> I'm sorry that I don't express so clear here. It means that RI successfully
> throws NPE while HY doesn't.
>

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

Re: [jira] Commented: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by Kevin Zhou <zh...@gmail.com>.
Thanks, Nathan.

I made some more test case to test the
MemoryNotificationInfo.from(CompositeData cd) method and found some new
problems.
I have raised another JIRA [1] for those new problems.

[1] https://issues.apache.org/jira/browse/HARMONY-6149

On Tue, Apr 14, 2009 at 8:34 AM, Nathan Beyer <nd...@apache.org> wrote:

> FYI - https://issues.apache.org/jira/browse/HARMONY-1284
>
> I ran into some issues with another class in lang.management a while
> back and decided to make MemoryUsage consistent with javadoc, not
> behavior of RI.
>
> -Nathan
>
> On Mon, Apr 13, 2009 at 3:59 AM, Kevin Zhou <zh...@gmail.com> wrote:
> >>
> >> >Is there any reason for Harmony to behave differently from RI?
> >
> > I don't think that there is any specific reason why HY behaves
> differently
> > from RI.
> >
> >
> >> >Just trying to check my understanding. Does RI smoothly throw NPE?
> >
> > I'm sorry that I don't express so clear here. It means that RI
> successfully
> > throws NPE while HY doesn't.
> >
>

Re: [jira] Commented: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by Nathan Beyer <nd...@apache.org>.
FYI - https://issues.apache.org/jira/browse/HARMONY-1284

I ran into some issues with another class in lang.management a while
back and decided to make MemoryUsage consistent with javadoc, not
behavior of RI.

-Nathan

On Mon, Apr 13, 2009 at 3:59 AM, Kevin Zhou <zh...@gmail.com> wrote:
>>
>> >Is there any reason for Harmony to behave differently from RI?
>
> I don't think that there is any specific reason why HY behaves differently
> from RI.
>
>
>> >Just trying to check my understanding. Does RI smoothly throw NPE?
>
> I'm sorry that I don't express so clear here. It means that RI successfully
> throws NPE while HY doesn't.
>

Re: [jira] Commented: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by Kevin Zhou <zh...@gmail.com>.
>
> >Is there any reason for Harmony to behave differently from RI?

I don't think that there is any specific reason why HY behaves differently
from RI.


> >Just trying to check my understanding. Does RI smoothly throw NPE?

I'm sorry that I don't express so clear here. It means that RI successfully
throws NPE while HY doesn't.

Re: [jira] Commented: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by Alexei Fedotov <al...@gmail.com>.
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 <zh...@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/

Re: [jira] Commented: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by Kevin Zhou <zh...@gmail.com>.
> 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?

[jira] Updated: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Zhou updated HARMONY-6148:
--------------------------------

    Attachment: HARMONY-6148.diff

Would you please try it?

> [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
>
>         Attachments: HARMONY-6148.diff
>
>   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.


[jira] Assigned: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Beyer reassigned HARMONY-6148:
-------------------------------------

    Assignee: Nathan Beyer

> [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
>            Assignee: Nathan Beyer
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6148.diff
>
>   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.


[jira] Closed: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Beyer closed HARMONY-6148.
---------------------------------


> [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
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6148.diff
>
>   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.


[jira] Commented: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Resolved: (HARMONY-6148) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should return null if the argument is null

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Beyer resolved HARMONY-6148.
-----------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 5.0M9)
                   5.0M10

A modified patch was applied at r768133. Please verify.

> [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
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6148.diff
>
>   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.