Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8025081

MBeanServerConnection.getAttributes might return null instead of empty AttributeList

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • tbd
    • None
    • core-svc

      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.

            Unassigned Unassigned
            mjoelson Mattias Joƫlson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: