Program: 66192
Project: 66192
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());
  }
  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.getType() != null) {
    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());
  }
  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.getType() != null) {
    Class theClass=null;
    if (property.isSetXmlJavaTypeAdapter()) {
      theClass=helper.getClassForJavaClass(property.getOriginalType());
    }
 else {
      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());
  }
  return mapping;
}