943 * an empty Descriptor. |
943 * an empty Descriptor. |
944 * @exception RuntimeOperationsException if Descriptor is invalid |
944 * @exception RuntimeOperationsException if Descriptor is invalid |
945 */ |
945 */ |
946 private Descriptor validDescriptor(final Descriptor in) throws RuntimeOperationsException { |
946 private Descriptor validDescriptor(final Descriptor in) throws RuntimeOperationsException { |
947 Descriptor clone; |
947 Descriptor clone; |
948 if (in == null) { |
948 boolean defaulted = (in == null); |
|
949 if (defaulted) { |
949 clone = new DescriptorSupport(); |
950 clone = new DescriptorSupport(); |
950 MODELMBEAN_LOGGER.finer("Null Descriptor, creating new."); |
951 MODELMBEAN_LOGGER.finer("Null Descriptor, creating new."); |
951 } else { |
952 } else { |
952 clone = (Descriptor) in.clone(); |
953 clone = (Descriptor) in.clone(); |
953 } |
954 } |
954 |
955 |
955 //Setting defaults. |
956 //Setting defaults. |
956 if (clone.getFieldValue("name")==null) { |
957 if (defaulted && clone.getFieldValue("name")==null) { |
957 clone.setField("name", this.getClassName()); |
958 clone.setField("name", this.getClassName()); |
958 MODELMBEAN_LOGGER.finer("Defaulting Descriptor name to " + this.getClassName()); |
959 MODELMBEAN_LOGGER.finer("Defaulting Descriptor name to " + this.getClassName()); |
959 } |
960 } |
960 if (clone.getFieldValue("descriptorType")==null) { |
961 if (defaulted && clone.getFieldValue("descriptorType")==null) { |
961 clone.setField("descriptorType", MMB); |
962 clone.setField("descriptorType", MMB); |
962 MODELMBEAN_LOGGER.finer("Defaulting descriptorType to \"" + MMB + "\""); |
963 MODELMBEAN_LOGGER.finer("Defaulting descriptorType to \"" + MMB + "\""); |
963 } |
964 } |
964 if (clone.getFieldValue("displayName") == null) { |
965 if (clone.getFieldValue("displayName") == null) { |
965 clone.setField("displayName",this.getClassName()); |
966 clone.setField("displayName",this.getClassName()); |