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

MBeanServerConnection.getAttributes might return null instead of empty AttributeList

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: