Program: 65125
Project: 65125
Buggy source:
/** 
 * Set a property on the JAXBMarshaller. Attempting to set any unsupported property will result in a javax.xml.bind.PropertyException  See <a href="#supportedProps">Supported Properties</a>.   
 */
public void setProperty(String key,Object value) throws PropertyException {
  try {
    if (key == null) {
      throw new IllegalArgumentException();
    }
 else     if (JAXB_FORMATTED_OUTPUT.equals(key)) {
      Boolean formattedOutput=(Boolean)value;
      xmlMarshaller.setFormattedOutput(formattedOutput.booleanValue());
    }
 else     if (JAXB_ENCODING.equals(key)) {
      xmlMarshaller.setEncoding((String)value);
    }
 else     if (JAXB_SCHEMA_LOCATION.equals(key)) {
      xmlMarshaller.setSchemaLocation((String)value);
    }
 else     if (JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(key)) {
      xmlMarshaller.setNoNamespaceSchemaLocation((String)value);
    }
 else     if (XMLConstants.JAXB_FRAGMENT.equals(key)) {
      Boolean fragment=(Boolean)value;
      xmlMarshaller.setFragment(fragment.booleanValue());
    }
 else     if (MarshallerProperties.NAMESPACE_PREFIX_MAPPER.equals(key)) {
      if (value instanceof Map) {
        NamespacePrefixMapper namespacePrefixMapper=new MapNamespacePrefixMapper((Map)value);
        xmlMarshaller.setNamespacePrefixMapper(namespacePrefixMapper);
      }
 else {
        xmlMarshaller.setNamespacePrefixMapper((NamespacePrefixMapper)value);
      }
    }
 else     if (SUN_NAMESPACE_PREFIX_MAPPER.equals(key) || SUN_JSE_NAMESPACE_PREFIX_MAPPER.equals(key)) {
      xmlMarshaller.setNamespacePrefixMapper(new NamespacePrefixMapperWrapper(value));
    }
 else     if (MarshallerProperties.INDENT_STRING.equals(key) || SUN_INDENT_STRING.equals(key) || SUN_JSE_INDENT_STRING.equals(key)) {
      xmlMarshaller.setIndentString((String)value);
    }
 else     if (MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS.equals(key)) {
      xmlMarshaller.setMarshalEmptyCollections((Boolean)value);
    }
 else     if (MarshallerProperties.CHARACTER_ESCAPE_HANDLER.equals(key)) {
      xmlMarshaller.setCharacterEscapeHandler((CharacterEscapeHandler)value);
    }
 else     if (SUN_CHARACTER_ESCAPE_HANDLER.equals(key) || SUN_JSE_CHARACTER_ESCAPE_HANDLER.equals(key)) {
      if (value == null) {
        xmlMarshaller.setCharacterEscapeHandler(null);
      }
 else {
        xmlMarshaller.setCharacterEscapeHandler(new CharacterEscapeHandlerWrapper(value));
      }
    }
 else     if (XML_DECLARATION.equals(key)) {
      Boolean fragment=!(Boolean)value;
      xmlMarshaller.setFragment(fragment.booleanValue());
    }
 else     if (XML_HEADERS.equals(key)) {
      xmlMarshaller.setXmlHeader((String)value);
    }
 else     if (MarshallerProperties.MEDIA_TYPE.equals(key)) {
      MediaType mType=null;
      if (value instanceof MediaType) {
        mType=(MediaType)value;
      }
 else       if (value instanceof String) {
        mType=MediaType.getMediaType((String)value);
      }
      if (mType != null) {
        xmlMarshaller.setMediaType(mType);
      }
 else {
        throw new PropertyException(key,value);
      }
    }
 else     if (MarshallerProperties.JSON_ATTRIBUTE_PREFIX.equals(key)) {
      xmlMarshaller.setAttributePrefix((String)value);
    }
 else     if (MarshallerProperties.JSON_INCLUDE_ROOT.equals(key)) {
      xmlMarshaller.setIncludeRoot((Boolean)value);
    }
 else     if (MarshallerProperties.JSON_VALUE_WRAPPER.equals(key)) {
      xmlMarshaller.setValueWrapper((String)value);
    }
 else     if (MarshallerProperties.JSON_NAMESPACE_SEPARATOR.equals(key)) {
      xmlMarshaller.setNamespaceSeparator((Character)value);
    }
 else {
      throw new PropertyException(key,value);
    }
  }
 catch (  ClassCastException exception) {
    throw new PropertyException(key,exception);
  }
}

Fixed version (ground truth):
/** 
 * Set a property on the JAXBMarshaller. Attempting to set any unsupported property will result in a javax.xml.bind.PropertyException  See <a href="#supportedProps">Supported Properties</a>.   
 */
public void setProperty(String key,Object value) throws PropertyException {
  try {
    if (key == null) {
      throw new IllegalArgumentException();
    }
 else     if (JAXB_FORMATTED_OUTPUT.equals(key)) {
      Boolean formattedOutput=(Boolean)value;
      xmlMarshaller.setFormattedOutput(formattedOutput.booleanValue());
    }
 else     if (JAXB_ENCODING.equals(key)) {
      xmlMarshaller.setEncoding((String)value);
    }
 else     if (JAXB_SCHEMA_LOCATION.equals(key)) {
      xmlMarshaller.setSchemaLocation((String)value);
    }
 else     if (JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(key)) {
      xmlMarshaller.setNoNamespaceSchemaLocation((String)value);
    }
 else     if (XMLConstants.JAXB_FRAGMENT.equals(key)) {
      Boolean fragment=(Boolean)value;
      xmlMarshaller.setFragment(fragment.booleanValue());
    }
 else     if (MarshallerProperties.NAMESPACE_PREFIX_MAPPER.equals(key)) {
      if (value instanceof Map) {
        NamespacePrefixMapper namespacePrefixMapper=new MapNamespacePrefixMapper((Map)value);
        xmlMarshaller.setNamespacePrefixMapper(namespacePrefixMapper);
      }
 else {
        xmlMarshaller.setNamespacePrefixMapper((NamespacePrefixMapper)value);
      }
    }
 else     if (SUN_NAMESPACE_PREFIX_MAPPER.equals(key) || SUN_JSE_NAMESPACE_PREFIX_MAPPER.equals(key)) {
      xmlMarshaller.setNamespacePrefixMapper(new NamespacePrefixMapperWrapper(value));
    }
 else     if (MarshallerProperties.INDENT_STRING.equals(key) || SUN_INDENT_STRING.equals(key) || SUN_JSE_INDENT_STRING.equals(key)) {
      xmlMarshaller.setIndentString((String)value);
    }
 else     if (MarshallerProperties.JSON_MARSHAL_EMPTY_COLLECTIONS.equals(key)) {
      xmlMarshaller.setMarshalEmptyCollections((Boolean)value);
    }
 else     if (MarshallerProperties.CHARACTER_ESCAPE_HANDLER.equals(key)) {
      xmlMarshaller.setCharacterEscapeHandler((CharacterEscapeHandler)value);
    }
 else     if (SUN_CHARACTER_ESCAPE_HANDLER.equals(key) || SUN_JSE_CHARACTER_ESCAPE_HANDLER.equals(key)) {
      if (value == null) {
        xmlMarshaller.setCharacterEscapeHandler(null);
      }
 else {
        xmlMarshaller.setCharacterEscapeHandler(new CharacterEscapeHandlerWrapper(value));
      }
    }
 else     if (XML_DECLARATION.equals(key)) {
      Boolean fragment=!(Boolean)value;
      xmlMarshaller.setFragment(fragment.booleanValue());
    }
 else     if (XML_HEADERS.equals(key)) {
      xmlMarshaller.setXmlHeader((String)value);
    }
 else     if (OBJECT_IDENTITY_CYCLE_DETECTION.equals(key)) {
      xmlMarshaller.setEqualUsingIdenity(((Boolean)value).booleanValue());
    }
 else     if (MarshallerProperties.MEDIA_TYPE.equals(key)) {
      MediaType mType=null;
      if (value instanceof MediaType) {
        mType=(MediaType)value;
      }
 else       if (value instanceof String) {
        mType=MediaType.getMediaType((String)value);
      }
      if (mType != null) {
        xmlMarshaller.setMediaType(mType);
      }
 else {
        throw new PropertyException(key,value);
      }
    }
 else     if (MarshallerProperties.JSON_ATTRIBUTE_PREFIX.equals(key)) {
      xmlMarshaller.setAttributePrefix((String)value);
    }
 else     if (MarshallerProperties.JSON_INCLUDE_ROOT.equals(key)) {
      xmlMarshaller.setIncludeRoot((Boolean)value);
    }
 else     if (MarshallerProperties.JSON_VALUE_WRAPPER.equals(key)) {
      xmlMarshaller.setValueWrapper((String)value);
    }
 else     if (MarshallerProperties.JSON_NAMESPACE_SEPARATOR.equals(key)) {
      xmlMarshaller.setNamespaceSeparator((Character)value);
    }
 else {
      throw new PropertyException(key,value);
    }
  }
 catch (  ClassCastException exception) {
    throw new PropertyException(key,exception);
  }
}