Program: 66834
Project: 66834
Buggy source:
public XMLCompositeObjectMapping generateCompositeObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,String referenceClassName){
  XMLCompositeObjectMapping mapping=new XMLCompositeObjectMapping();
  mapping.setAttributeName(property.getPropertyName());
  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.isNillable()) {
    mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
  }
  mapping.setXPath(getXPathForField(property,namespaceInfo,false).getXPath());
  if (referenceClassName == null) {
    ((XMLField)mapping.getField()).setIsTypedTextField(true);
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.ANY_TYPE_QNAME);
    String defaultValue=property.getDefaultValue();
    if (null != defaultValue) {
      mapping.setConverter(new DefaultElementConverter(defaultValue));
    }
  }
 else {
    mapping.setReferenceClassName(referenceClassName);
  }
  if (property.getBackpointerPropertyName() != null) {
    mapping.setContainerAttributeName(property.getBackpointerPropertyName());
    if (!property.getBackpointerGetMethodName().equals("String_Node_Str") && !property.getBackpointerSetMethodName().equals("String_Node_Str")) {
      mapping.setContainerGetMethodName(property.getBackpointerSetMethodName());
      mapping.setContainerSetMethodName(property.getBackpointerSetMethodName());
    }
  }
  if (property.isRequired()) {
    ((XMLField)mapping.getField()).setRequired(true);
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLCompositeObjectMapping generateCompositeObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,String referenceClassName){
  XMLCompositeObjectMapping mapping=new XMLCompositeObjectMapping();
  mapping.setAttributeName(property.getPropertyName());
  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.isNillable()) {
    mapping.getNullPolicy().setNullRepresentedByXsiNil(true);
  }
  mapping.setXPath(getXPathForField(property,namespaceInfo,false).getXPath());
  if (referenceClassName == null) {
    ((XMLField)mapping.getField()).setIsTypedTextField(true);
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.ANY_TYPE_QNAME);
    String defaultValue=property.getDefaultValue();
    if (null != defaultValue) {
      mapping.setConverter(new DefaultElementConverter(defaultValue));
    }
  }
 else {
    mapping.setReferenceClassName(referenceClassName);
  }
  if (property.getBidirectionalPropertyName() != null) {
    mapping.setContainerAttributeName(property.getBidirectionalPropertyName());
    JavaClass backPointerPropertyType=null;
    JavaClass referenceClass=property.getActualType();
    if (property.getBidirectionalPropertyGetMethodName() != null && property.getBidirectionalPropertySetMethodName() != null && !property.getBidirectionalPropertyGetMethodName().equals("String_Node_Str") && !property.getBidirectionalPropertySetMethodName().equals("String_Node_Str")) {
      mapping.setContainerGetMethodName(property.getBidirectionalPropertySetMethodName());
      mapping.setContainerSetMethodName(property.getBidirectionalPropertySetMethodName());
      JavaMethod getMethod=referenceClass.getDeclaredMethod(mapping.getContainerGetMethodName(),new JavaClass[]{});
      if (getMethod != null) {
        backPointerPropertyType=getMethod.getReturnType();
      }
    }
 else {
      JavaField backpointerField=referenceClass.getDeclaredField(property.getBidirectionalPropertyName());
      if (backpointerField != null) {
        backPointerPropertyType=backpointerField.getResolvedType();
      }
    }
    if (isCollectionType(backPointerPropertyType)) {
      mapping.getBidirectionalPolicy().setBidirectionalTargetContainerPolicy(ContainerPolicy.buildDefaultPolicy());
    }
  }
  if (property.isRequired()) {
    ((XMLField)mapping.getField()).setRequired(true);
  }
  descriptor.addMapping(mapping);
  return mapping;
}