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-6149) [classlib][lang-management] java.lang.management.MemoryNotificationInfo.from(CompositeData cd) should throw IllegalArgumentException if cd doesn't represent a MemoryNotificationInfo object
Date Thu, 30 Apr 2009 02:14:30 GMT

    [ 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.


Mime
View raw message