-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
5.0
-
generic
-
generic
com.sun.management.RuntimeMBean.getSystemProperties currently returns
CompositeData where each item name is the property name. It means that
potentially, every time you retrieve this value it has a different CompositeType.
Different CompositeType is not desired since it may restrict future
evolution.
Eamonn pointed out this issue and suggests the following approaches:
> I just now saw this new method. The proposed approach of returning a
> CompositeData where each item has the property name as its name and the
> property value as its value seems strange to me. It means that,
> potentially, every time you retrieve this value it has a different
> CompositeType. Likewise, it means that if some day this MBean becomes
> an Open MBean, its OpenMBeanInfo will not be constant.
>
> I can see at least three better approaches:
>
> (1) The type is String[], where each element is "name=value".
> (2) The type is String[][], where value[i][0] is the name of property i
> and value[i][1] is its value.
> (3) The type is TabularData, where the associated TabularType has as its
> rowType a CompositeType with items "name" and "value", and where "name"
> is the index.
>
Since the system properties are simply name-value pairs and are Strings,
CompositeData where each item name is the property name. It means that
potentially, every time you retrieve this value it has a different CompositeType.
Different CompositeType is not desired since it may restrict future
evolution.
Eamonn pointed out this issue and suggests the following approaches:
> I just now saw this new method. The proposed approach of returning a
> CompositeData where each item has the property name as its name and the
> property value as its value seems strange to me. It means that,
> potentially, every time you retrieve this value it has a different
> CompositeType. Likewise, it means that if some day this MBean becomes
> an Open MBean, its OpenMBeanInfo will not be constant.
>
> I can see at least three better approaches:
>
> (1) The type is String[], where each element is "name=value".
> (2) The type is String[][], where value[i][0] is the name of property i
> and value[i][1] is its value.
> (3) The type is TabularData, where the associated TabularType has as its
> rowType a CompositeType with items "name" and "value", and where "name"
> is the index.
>
Since the system properties are simply name-value pairs and are Strings,
- duplicates
-
JDK-5001896 Sun-specific RuntimeMBean.getSystemProperties should return String[][]
-
- Closed
-