-
Bug
-
Resolution: Not an Issue
-
P4
-
None
If you invoke getAttributes with at least one of the attribute names being null you might get the return value null instead of getting an empty AttributeList or some Exception. This has been observed at least for javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection and I believe this contradicts the javadoc for that interface method.
My worry is that this might be the case for other implementors of MBeanServerConnection as well.
This problem was provoked by creating a rather broken dynamic MBean with attribute descriptions like this:
MBeanAttributeInfo[] attributes = {new MBeanAttributeInfo(null, null, null, true, true, false), new MBeanAttributeInfo("noType", null, null, true, true, false), new MBeanAttributeInfo("wrongType", Integer.TYPE.getName(), null, true, true, false), new MBeanAttributeInfo("badType", "UggaBugga", null, true, true, false), new MBeanAttributeInfo("badValue", Integer.TYPE.getName(), null, true, true, false), new MBeanAttributeInfo("badNull", null, null, true, true, false)};
Maybe we should ponder the idea that name nor type can be null when creating a MBeanAttributeInfo.
My worry is that this might be the case for other implementors of MBeanServerConnection as well.
This problem was provoked by creating a rather broken dynamic MBean with attribute descriptions like this:
MBeanAttributeInfo[] attributes = {new MBeanAttributeInfo(null, null, null, true, true, false), new MBeanAttributeInfo("noType", null, null, true, true, false), new MBeanAttributeInfo("wrongType", Integer.TYPE.getName(), null, true, true, false), new MBeanAttributeInfo("badType", "UggaBugga", null, true, true, false), new MBeanAttributeInfo("badValue", Integer.TYPE.getName(), null, true, true, false), new MBeanAttributeInfo("badNull", null, null, true, true, false)};
Maybe we should ponder the idea that name nor type can be null when creating a MBeanAttributeInfo.