Program: 66296
Project: 66296
Buggy source:
public XMLDirectMapping generateDirectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLDirectMapping mapping=new XMLDirectMapping();
  mapping.setAttributeName(property.getPropertyName());
  String fixedValue=property.getFixedValue();
  if (fixedValue != null) {
    mapping.setIsWriteOnly(true);
  }
  if (property.isSetReadOnly()) {
    mapping.setIsReadOnly(property.isReadOnly());
  }
  if (property.isSetWriteOnly()) {
    mapping.setIsWriteOnly(property.isWriteOnly());
  }
  if (property.isMethodProperty()) {
    if (property.getGetMethodName() == null) {
      String paramTypeAsString=property.getType().getName();
      mapping.setAttributeAccessor(new JAXBSetMethodAttributeAccessor(paramTypeAsString,helper.getClassLoader()));
      mapping.setIsReadOnly(true);
      mapping.setSetMethodName(property.getSetMethodName());
    }
 else     if (property.getSetMethodName() == null) {
      mapping.setGetMethodName(property.getGetMethodName());
      mapping.setIsWriteOnly(true);
    }
 else {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  if (property.getXmlPath() != null) {
    mapping.setField(new XMLField(property.getXmlPath()));
  }
 else {
    mapping.setField(getXPathForField(property,namespaceInfo,true));
  }
  if (property.getDefaultValue() != null) {
    mapping.setNullValue(property.getDefaultValue());
  }
 else   if (property.getType().getRawName().equals("String_Node_Str")) {
    mapping.setNullValue("String_Node_Str");
  }
  if (property.isSetNullPolicy()) {
    mapping.setNullPolicy(getNullPolicyFromProperty(property,namespaceInfo.getNamespaceResolverForDescriptor()));
  }
 else {
    if (property.isNillable()) {
      mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
    }
    mapping.getNullPolicy().setNullRepresentedByEmptyNode(false);
    if (!mapping.getXPath().equals("String_Node_Str")) {
      ((NullPolicy)mapping.getNullPolicy()).setSetPerformedForAbsentNode(false);
    }
  }
  if (property.isRequired()) {
    ((XMLField)mapping.getField()).setRequired(true);
  }
  if (property.isXmlElementType()) {
    Class theClass=helper.getClassForJavaClass(property.getType());
    mapping.setAttributeClassification(theClass);
  }
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  if (property.isSetCdata()) {
    mapping.setIsCDATA(property.isCdata());
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLDirectMapping generateDirectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLDirectMapping mapping=new XMLDirectMapping();
  mapping.setAttributeName(property.getPropertyName());
  String fixedValue=property.getFixedValue();
  if (fixedValue != null) {
    mapping.setIsWriteOnly(true);
  }
  if (property.isSetReadOnly()) {
    mapping.setIsReadOnly(property.isReadOnly());
  }
  if (property.isSetWriteOnly()) {
    mapping.setIsWriteOnly(property.isWriteOnly());
  }
  if (property.isMethodProperty()) {
    if (property.getGetMethodName() == null) {
      String paramTypeAsString=property.getType().getName();
      mapping.setAttributeAccessor(new JAXBSetMethodAttributeAccessor(paramTypeAsString,helper.getClassLoader()));
      mapping.setIsReadOnly(true);
      mapping.setSetMethodName(property.getSetMethodName());
    }
 else     if (property.getSetMethodName() == null) {
      mapping.setGetMethodName(property.getGetMethodName());
      mapping.setIsWriteOnly(true);
    }
 else {
      mapping.setSetMethodName(property.getSetMethodName());
      mapping.setGetMethodName(property.getGetMethodName());
    }
  }
  if (property.getXmlPath() != null) {
    mapping.setField(new XMLField(property.getXmlPath()));
  }
 else {
    mapping.setField(getXPathForField(property,namespaceInfo,true));
  }
  if (property.getDefaultValue() != null) {
    mapping.setNullValue(property.getDefaultValue());
  }
  if (property.isSetNullPolicy()) {
    mapping.setNullPolicy(getNullPolicyFromProperty(property,namespaceInfo.getNamespaceResolverForDescriptor()));
  }
 else {
    if (property.isNillable()) {
      mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
    }
    mapping.getNullPolicy().setNullRepresentedByEmptyNode(false);
    if (!mapping.getXPath().equals("String_Node_Str")) {
      ((NullPolicy)mapping.getNullPolicy()).setSetPerformedForAbsentNode(false);
    }
  }
  if (property.isRequired()) {
    ((XMLField)mapping.getField()).setRequired(true);
  }
  if (property.isXmlElementType()) {
    Class theClass=helper.getClassForJavaClass(property.getType());
    mapping.setAttributeClassification(theClass);
  }
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  if (property.isSetCdata()) {
    mapping.setIsCDATA(property.isCdata());
  }
  descriptor.addMapping(mapping);
  return mapping;
}