United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6333561 MBeans tab: Attributes of type CompositeData[] are not rendered well
JDK-6333561 : MBeans tab: Attributes of type CompositeData[] are not rendered well

Details
Type:
Bug
Submit Date:
2005-10-06
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
tools
OS:
windows_xp
Sub-Component:
jconsole
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:

Related Reports
Backport:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]


A DESCRIPTION OF THE PROBLEM :
Despite accurately reporting the attribute type in the MBeanInfo (including a full description of the CompositeData involved), jconsole does not produce a useful rendering of CompositeData[] attributes.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I created a standard MBean returning this data, extending StandardMBean and then augmenting the MBeanInfo as necessary.  I believe all that is *necessary* to produce this issue is to have a CompositeData[] attribute, though.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would have expected the same sort of CompositeData[] treatment as nested fields of this type within CompositeData (e.g. within thread info) get -- but that does not seem to be the way top-level attributes of type CompositeData[] are treated.
ACTUAL -
The result was essentially a useless toString() rendering of the array!

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
I had to return TabularData using the arrayIndex as the key, but this does not produce the clearly desired order (idx=0,1,2,...) but rather random (hash) ordering based on Object[new Integer(idx)].

                                    

Comments
EVALUATION

Add support for arrays and collections of CompositeData and TabularData.
                                     
2006-11-28



Hardware and Software, Engineered to Work Together