diff -r 460e37d40f12 -r acaa49a2768a jdk/src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java --- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java Wed Oct 21 16:28:57 2009 +0200 +++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java Wed Oct 21 17:33:18 2009 +0200 @@ -945,7 +945,8 @@ */ private Descriptor validDescriptor(final Descriptor in) throws RuntimeOperationsException { Descriptor clone; - if (in == null) { + boolean defaulted = (in == null); + if (defaulted) { clone = new DescriptorSupport(); MODELMBEAN_LOGGER.finer("Null Descriptor, creating new."); } else { @@ -953,11 +954,11 @@ } //Setting defaults. - if (clone.getFieldValue("name")==null) { + if (defaulted && clone.getFieldValue("name")==null) { clone.setField("name", this.getClassName()); MODELMBEAN_LOGGER.finer("Defaulting Descriptor name to " + this.getClassName()); } - if (clone.getFieldValue("descriptorType")==null) { + if (defaulted && clone.getFieldValue("descriptorType")==null) { clone.setField("descriptorType", MMB); MODELMBEAN_LOGGER.finer("Defaulting descriptorType to \"" + MMB + "\""); }