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

Provide for the user mandatory fields missing in Descriptor given to Model*Info constructors

XMLWordPrintable

    • b17
    • generic
    • generic
    • Not verified

        For ModelMBeanAttributeInfo, ModelMBeanInfoSupport, ModelMBeanConstructorInfo
        ModelMBeanNotificationInfo and ModelMBeanOperationInfo, the descriptor provided
        to the relevant constructors must contain at least two fields : name and descriptorType.
        The field name is already provided as another constructor parameter.
        The field descriptorType has a single possible value except for ModelMBeanOperationInfo where 3 values are valid but one is defined as default.

        Current specified behavior is to throw RuntimeOperationsException when either field name or descriptorType is missing.

        User scenario is that you get a RuntimeOperationsException because the descriptor you provide is not valid and you wonder why. The javadoc does not explain what is a valid descriptor except for method DescriptorSupport.isValid() but there is no href from all constructors taking a Descriptor so it is unfriendly.

        Because the constructor has all in hands to add itself the missing fields, it might do so.
        Asking the user some input the implementation could provide for him is avoidable complexity.

        That approach could be extended to other fields defined as mandatory for a particular class.

        ###@###.### 2005-04-08 15:21:47 GMT

              emcmanus Eamonn McManus
              yjoan Yves Joan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: