Program: 66832
Project: 66832
Buggy source:
public XMLCompositeCollectionMapping generateCompositeCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,String referenceClassName){
  XMLCompositeCollectionMapping mapping=new XMLCompositeCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  mapping.setReuseContainer(true);
  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);
  }
  JavaClass collectionType=property.getType();
  if (collectionType.isArray()) {
    JAXBObjectArrayAttributeAccessor accessor=new JAXBObjectArrayAttributeAccessor(mapping.getAttributeAccessor(),mapping.getContainerPolicy());
    accessor.setComponentClassName(collectionType.getComponentType().getRawName());
    mapping.setAttributeAccessor(accessor);
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  XMLField xmlField=getXPathForField(property,namespaceInfo,false);
  mapping.setXPath(xmlField.getXPath());
  if (referenceClassName == null) {
    ((XMLField)mapping.getField()).setIsTypedTextField(true);
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.ANY_TYPE_QNAME);
  }
 else {
    mapping.setReferenceClassName(referenceClassName);
  }
  if (property.isRequired()) {
    ((XMLField)mapping.getField()).setRequired(true);
  }
  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());
    }
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLCompositeCollectionMapping generateCompositeCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo,String referenceClassName){
  XMLCompositeCollectionMapping mapping=new XMLCompositeCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  mapping.setReuseContainer(true);
  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);
  }
  JavaClass collectionType=property.getType();
  if (collectionType.isArray()) {
    JAXBObjectArrayAttributeAccessor accessor=new JAXBObjectArrayAttributeAccessor(mapping.getAttributeAccessor(),mapping.getContainerPolicy());
    accessor.setComponentClassName(collectionType.getComponentType().getRawName());
    mapping.setAttributeAccessor(accessor);
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  XMLField xmlField=getXPathForField(property,namespaceInfo,false);
  mapping.setXPath(xmlField.getXPath());
  if (referenceClassName == null) {
    ((XMLField)mapping.getField()).setIsTypedTextField(true);
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.ANY_TYPE_QNAME);
  }
 else {
    mapping.setReferenceClassName(referenceClassName);
  }
  if (property.isRequired()) {
    ((XMLField)mapping.getField()).setRequired(true);
  }
  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());
    }
  }
  descriptor.addMapping(mapping);
  return mapping;
}