United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6486655 REGRESSION: Standard MBean attributes and operations lose original interface order
6486655 : REGRESSION: Standard MBean attributes and operations lose original interface order

Details
Type:
Bug
Submit Date:
2006-10-26
Status:
Resolved
Updated Date:
2010-07-29
Project Name:
JDK
Resolved Date:
2007-03-24
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
6u2

Related Reports
Backport:

Sub Tasks

Description
My server side uses JDK6, my client side JDK5.
I call getMBeanInfo localy and remotely on the same standard MBean,
then check for equality calling MBeanInfo.equals
This call return false because the two MBeanInfo objects return the same values 
in their MBeanFeatureInfo arrays but in a different order.

With JDK6, the alphabetic order seems to be used while in JDK5,
it's the declaration order that is used.

                                    

Comments
SUGGESTED FIX

Use a LinkedHashMap instead of a TreeMap in com.sun.jmx.mbeanserver.MBeanAnalyzer for attrMap and opMap.
                                     
2006-10-26
EVALUATION

It appears indeed that attributes and operations in a Standard MBean are now sorted, whereas in JDK 5.0 they appeared in the same order as the corresponding methods in the MBean interface.  This does not violate the specification, but could surprise existing code.  We should restore the JDK 5.0 behaviour.

Notice that the method eliminateCovariantMethods in this class has a comment about preserving order, which it does, but to no avail because the order is lost elsewhere.
                                     
2006-10-26



Hardware and Software, Engineered to Work Together