JDK-6333561 : MBeans tab: Attributes of type CompositeData[] are not rendered well
  • Type: Bug
  • Component: tools
  • Sub-Component: jconsole
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-10-06
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u4Fixed 7 b05Fixed
Related Reports
Relates :  
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.
28-11-2006