Program: 65616
Project: 65616
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());
    }
  }
  XMLField xmlField=getXPathForField(property,namespaceInfo,true);
  mapping.setField(xmlField);
  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().setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
    }
    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) {
    String theClass=null;
    if (property.isSetXmlJavaTypeAdapter()) {
      theClass=property.getOriginalType().getQualifiedName();
    }
 else {
      theClass=property.getType().getQualifiedName();
    }
    mapping.setAttributeClassificationName(theClass);
    try {
      JavaClass actualJavaClass=helper.getJavaClass(theClass);
      Class actualClass=helper.getClassForJavaClass(actualJavaClass);
      mapping.setAttributeClassification(actualClass);
    }
 catch (    Exception e) {
    }
  }
  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());
    }
  }
  XMLField xmlField=getXPathForField(property,namespaceInfo,true);
  mapping.setField(xmlField);
  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().setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
    }
    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) {
    String theClass=null;
    if (property.isSetXmlJavaTypeAdapter()) {
      theClass=property.getOriginalType().getQualifiedName();
    }
 else {
      theClass=property.getType().getQualifiedName();
    }
    try {
      JavaClass actualJavaClass=helper.getJavaClass(theClass);
      Class actualClass=helper.getClassForJavaClass(actualJavaClass);
      mapping.setAttributeClassification(actualClass);
    }
 catch (    Exception e) {
      mapping.setAttributeClassificationName(theClass);
    }
  }
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  if (property.isSetCdata()) {
    mapping.setIsCDATA(property.isCdata());
  }
  return mapping;
}