Program: 66857
Project: 66857
Buggy source:
private Property buildChoiceProperty(TypeInfo info,JavaClass cls,JavaHasAnnotations javaHasAnnotations,String propertyName,JavaClass propertyType){
  ChoiceProperty property=new ChoiceProperty(helper);
  XmlElements xmlElements=(XmlElements)helper.getAnnotation(javaHasAnnotations,XmlElements.class);
  XmlElement[] elements=xmlElements.value();
  ArrayList<Property> choiceProperties=new ArrayList<Property>(elements.length);
  validateElementIsInPropOrder(info,propertyName);
  for (int i=0; i < elements.length; i++) {
    XmlElement next=elements[i];
    Property choiceProp=new Property(helper);
    String name=next.name();
    String namespace=next.namespace();
    QName qName=null;
    if (name.equals("String_Node_Str")) {
      name=propertyName;
    }
    if (!namespace.equals("String_Node_Str")) {
      qName=new QName(namespace,name);
    }
 else {
      NamespaceInfo namespaceInfo=getNamespaceInfoForPackage(cls);
      if (namespaceInfo.isElementFormQualified()) {
        qName=new QName(namespaceInfo.getNamespace(),name);
      }
 else {
        qName=new QName(name);
      }
    }
    choiceProp.setPropertyName(property.getPropertyName());
    Class typeClass=next.type();
    if (typeClass.equals(XmlElement.DEFAULT.class)) {
      choiceProp.setType(propertyType);
    }
 else {
      choiceProp.setType(helper.getJavaClass(typeClass));
    }
    choiceProp.setSchemaName(qName);
    choiceProp.setSchemaType(getSchemaTypeFor(choiceProp.getType()));
    choiceProp.setElement(javaHasAnnotations);
    choiceProperties.add(choiceProp);
  }
  property.setChoiceProperties(choiceProperties);
  return property;
}

Fixed version (ground truth):
private Property buildChoiceProperty(TypeInfo info,JavaClass cls,JavaHasAnnotations javaHasAnnotations,String propertyName,JavaClass propertyType){
  ChoiceProperty property=new ChoiceProperty(helper);
  XmlElements xmlElements=(XmlElements)helper.getAnnotation(javaHasAnnotations,XmlElements.class);
  XmlElement[] elements=xmlElements.value();
  ArrayList<Property> choiceProperties=new ArrayList<Property>(elements.length);
  boolean isIdRef=helper.isAnnotationPresent(javaHasAnnotations,XmlIDREF.class);
  property.setIsXmlIdRef(isIdRef);
  validateElementIsInPropOrder(info,propertyName);
  for (int i=0; i < elements.length; i++) {
    XmlElement next=elements[i];
    Property choiceProp=new Property(helper);
    String name=next.name();
    String namespace=next.namespace();
    QName qName=null;
    if (name.equals("String_Node_Str")) {
      name=propertyName;
    }
    if (!namespace.equals("String_Node_Str")) {
      qName=new QName(namespace,name);
    }
 else {
      NamespaceInfo namespaceInfo=getNamespaceInfoForPackage(cls);
      if (namespaceInfo.isElementFormQualified()) {
        qName=new QName(namespaceInfo.getNamespace(),name);
      }
 else {
        qName=new QName(name);
      }
    }
    choiceProp.setPropertyName(property.getPropertyName());
    Class typeClass=next.type();
    if (typeClass.equals(XmlElement.DEFAULT.class)) {
      choiceProp.setType(propertyType);
    }
 else {
      choiceProp.setType(helper.getJavaClass(typeClass));
    }
    choiceProp.setSchemaName(qName);
    choiceProp.setSchemaType(getSchemaTypeFor(choiceProp.getType()));
    choiceProp.setElement(javaHasAnnotations);
    choiceProp.setIsXmlIdRef(isIdRef);
    choiceProperties.add(choiceProp);
  }
  property.setChoiceProperties(choiceProperties);
  return property;
}