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/14 04:24:15 UTC

[jira] Created: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

[classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-6149
                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M8
            Reporter: Kevin Zhou
             Fix For: 5.0M9


For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:

ATTRIBUTE_NAME	TYPE
poolName	java.lang.String
usage	javax.management.openmbean.CompositeData
count 	java.lang.Long

Otherwise, it should throw an java.lang.IllegalArgumentException.

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


Re: [jira] Updated: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by Kevin Zhou <zh...@gmail.com>.
Please ignore this. Sorry for this repeated operations. It's due to the
network problem.

On Wed, Apr 29, 2009 at 3:49 PM, Kevin Zhou (JIRA) <ji...@apache.org> wrote:

>
>     [
> https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Kevin Zhou updated HARMONY-6149:
> --------------------------------
>
>     Attachment: HARMONY-6149.diff
>
> > [classlib][lang-management]
> java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should
> throw IllegalArgumentException if cd doesn't represent a
> MemoryNotificationInfo object
> >
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> >
> >                 Key: HARMONY-6149
> >                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
> >             Project: Harmony
> >          Issue Type: Bug
> >          Components: Classlib
> >    Affects Versions: 5.0M8, 5.0M9
> >            Reporter: Kevin Zhou
> >            Assignee: Nathan Beyer
> >             Fix For: 5.0M10
> >
> >         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
> >
> >   Original Estimate: 48h
> >  Remaining Estimate: 48h
> >
> > For java.lang.management.MemoryNotificationInfo.from(CompositeData cd)
> method, the Java Spec has specifies that the given CompositeData must
> contains the following attributes:
> > ATTRIBUTE_NAME        TYPE
> > poolName      java.lang.String
> > usage javax.management.openmbean.CompositeData
> > count         java.lang.Long
> > Otherwise, it should throw an java.lang.IllegalArgumentException.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Resolved: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Nathan Beyer resolved HARMONY-6149.
-----------------------------------

    Resolution: Fixed

I've committed a fix at r769633 along with the test case attached to the issue. I modified the test to remove the InvalidKeyException catches, since those are IllegalArgumentExceptions anyway.

Please verify. Thanks.

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Assigned: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Nathan Beyer reassigned HARMONY-6149:
-------------------------------------

    Assignee: Nathan Beyer

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704442#action_12704442 ] 

Kevin Zhou commented on HARMONY-6149:
-------------------------------------

Hi Nathan,
Previously, our code doesn't check the type and data of the argument of the "from(CompositeData cd)" method. Obviously, the code is not right since it doesn't throw IllegalArgumentException in the scenarios specified in Java Spec. The patch you provided for MemoryNotificationInfo class could help to pass the former tests that I gave. But it can not pass all of the tests in the latest patch. In addition, I found that we have already implemented several useful util-methods in ManagementUtils class which has been used by ThreadInfo for the similar validation of type and data. In fact, I found some logical errors of such util-methods, I have fixed them in the latest patch as well. Then, I reuse the util-methods in MemoryNotificationInfo. I think it is worth of making such modifications. Do you agree with me?
Thanks!


> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Updated: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Nathan Beyer updated HARMONY-6149:
----------------------------------

           Patch Info: [Patch Available]
    Affects Version/s: 5.0M9
        Fix Version/s:     (was: 5.0M9)
                       5.0M10

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>             Fix For: 5.0M10
>
>         Attachments: HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704474#action_12704474 ] 

Kevin Zhou commented on HARMONY-6149:
-------------------------------------

The new patch version2 has been attached. 
In addition, the ThreadInfoTest locates at "lang-management/src/test/impl/java" directory. I think it should be relocated at "/lang-management/src/test/api/java" since it is a test for Java API not a specific implementation. Do you agree with me?

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY-6149v2.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Updated: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Kevin Zhou updated HARMONY-6149:
--------------------------------

    Attachment: HARMONY-6149.diff

Would you please help to try it?

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704394#action_12704394 ] 

Nathan Beyer commented on HARMONY-6149:
---------------------------------------

Can you explain the other changes? This seems to add quite a bit of complexity to the code - is it worth it?

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Updated: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Kevin Zhou updated HARMONY-6149:
--------------------------------

    Attachment: HARMONY-6149.diff

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Updated: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Kevin Zhou updated HARMONY-6149:
--------------------------------

    Attachment: HARMONY-6149v2.diff

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY-6149v2.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Updated: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Kevin Zhou updated HARMONY-6149:
--------------------------------

    Attachment: HARMONY6149Test.java

Would you please try it?

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>             Fix For: 5.0M9
>
>         Attachments: HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12703945#action_12703945 ] 

Nathan Beyer commented on HARMONY-6149:
---------------------------------------

The attached file isn't a patch, it's just a test. Did you have a patch to fix this issue?

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704024#action_12704024 ] 

Kevin Zhou commented on HARMONY-6149:
-------------------------------------

Hi Nathan,
This patch provides more test cases to test the behaviors of MemoryNotificationInfo.from(CompositeData cd) method.
Also, a fix is also included in. 
Thanks,
Kevin Zhou


> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Closed: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Kevin Zhou closed HARMONY-6149.
-------------------------------


Thanks, Nathan.

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY-6149v2.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Updated: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Kevin Zhou updated HARMONY-6149:
--------------------------------

    Attachment:     (was: HARMONY-6149.diff)

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704463#action_12704463 ] 

Nathan Beyer commented on HARMONY-6149:
---------------------------------------

Is an additional test added for ThreadInfo? Can you update the javadoc for the change in the APIs behavior? Perhaps a more logical param name would be helpful too - 'minSize'.

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12705382#action_12705382 ] 

Nathan Beyer commented on HARMONY-6149:
---------------------------------------

I've applied the second path at r771022. Please verify that it's as expected.

Thanks.

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY-6149v2.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Updated: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Kevin Zhou updated HARMONY-6149:
--------------------------------

    Attachment:     (was: HARMONY-6149.diff)

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704454#action_12704454 ] 

Kevin Zhou commented on HARMONY-6149:
-------------------------------------

Currently, this method is only used by ThreadInfo.from(CompositeData cd). It checks the number of how many fields a given composite data has wrapped. But the previous validation is too serious. For example, the composite data for ThreadInfo.from(...) method should have at least 13 fields but the number can also be more. But it should throw IllegalArgumentException if the data doesn't have enough fields inside less than 13.

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12703961#action_12703961 ] 

Kevin Zhou commented on HARMONY-6149:
-------------------------------------

Hi Nathan, 
The patch is not ready. 
I just report this defect and hope someone interested in it can try to fix it with me. ;)
I'll update it ASAP.

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Commented: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704444#action_12704444 ] 

Nathan Beyer commented on HARMONY-6149:
---------------------------------------

This change just seems like a style issue, not a bug fix.

     public static void verifyFieldNumber(CompositeData cd, int i) {
-        if (cd.values().size() != i) {
+        if (cd.values().size() < i) {
             throw new IllegalArgumentException(
                     "CompositeData object does not have the expected number of attributes"); //$NON-NLS-1$
         }

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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


[jira] Updated: (HARMONY-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object

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

Kevin Zhou updated HARMONY-6149:
--------------------------------

    Attachment: HARMONY-6149.diff

> [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6149
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6149
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8, 5.0M9
>            Reporter: Kevin Zhou
>            Assignee: Nathan Beyer
>             Fix For: 5.0M10
>
>         Attachments: HARMONY-6149.diff, HARMONY6149Test.java
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> For java.lang.management.MemoryNotificationInfo.from(CompositeData cd) method, the Java Spec has specifies that the given CompositeData must contains the following attributes:
> ATTRIBUTE_NAME	TYPE
> poolName	java.lang.String
> usage	javax.management.openmbean.CompositeData
> count 	java.lang.Long
> Otherwise, it should throw an java.lang.IllegalArgumentException.

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