Program: 67236
Project: 67236
Buggy source:
private Property buildNewProperty(TypeInfo info,JavaClass cls,JavaHasAnnotations javaHasAnnotations,String propertyName,JavaClass ptype){
  Property property=null;
  if (helper.isAnnotationPresent(javaHasAnnotations,XmlElements.class)) {
    property=buildChoiceProperty(info,cls,javaHasAnnotations,propertyName,ptype);
  }
 else   if (helper.isAnnotationPresent(javaHasAnnotations,XmlAnyElement.class)) {
    property=new AnyProperty(helper);
    XmlAnyElement anyElement=(XmlAnyElement)helper.getAnnotation(javaHasAnnotations,XmlAnyElement.class);
    ((AnyProperty)property).setDomHandlerClass(anyElement.value());
    ((AnyProperty)property).setLax(anyElement.lax());
  }
 else   if (helper.isAnnotationPresent(javaHasAnnotations,XmlElementRef.class) || helper.isAnnotationPresent(javaHasAnnotations,XmlElementRefs.class)) {
    property=buildReferenceProperty(info,cls,javaHasAnnotations,propertyName,ptype);
  }
 else {
    property=new Property(helper);
  }
  property.setPropertyName(propertyName);
  property.setElement(javaHasAnnotations);
  if (!helper.isAnnotationPresent(ptype,XmlTransient.class)) {
    property.setType(ptype);
  }
 else {
    JavaClass parent=ptype.getSuperclass();
    while (parent != null) {
      if (parent.getName().equals("String_Node_Str")) {
        property.setType(parent);
        break;
      }
      if (!helper.isAnnotationPresent(parent,XmlTransient.class)) {
        property.setType(parent);
        break;
      }
      parent=parent.getSuperclass();
    }
  }
  property.setSchemaName(getQNameForProperty(propertyName,javaHasAnnotations,getNamespaceInfoForPackage(cls)));
  processPropertyAnnotations(info,cls,javaHasAnnotations,property);
  ptype=property.getActualType();
  if (ptype.isPrimitive() || ptype.isArray() && ptype.getComponentType().isPrimitive()) {
    property.setIsRequired(true);
  }
  return property;
}

Fixed version (ground truth):
private Property buildNewProperty(TypeInfo info,JavaClass cls,JavaHasAnnotations javaHasAnnotations,String propertyName,JavaClass ptype){
  Property property=null;
  if (helper.isAnnotationPresent(javaHasAnnotations,XmlElements.class)) {
    property=buildChoiceProperty(info,cls,javaHasAnnotations,propertyName,ptype);
  }
 else   if (helper.isAnnotationPresent(javaHasAnnotations,XmlAnyElement.class)) {
    property=new AnyProperty(helper);
    XmlAnyElement anyElement=(XmlAnyElement)helper.getAnnotation(javaHasAnnotations,XmlAnyElement.class);
    ((AnyProperty)property).setDomHandlerClass(anyElement.value());
    ((AnyProperty)property).setLax(anyElement.lax());
  }
 else   if (helper.isAnnotationPresent(javaHasAnnotations,XmlElementRef.class) || helper.isAnnotationPresent(javaHasAnnotations,XmlElementRefs.class)) {
    property=buildReferenceProperty(info,cls,javaHasAnnotations,propertyName,ptype);
  }
 else {
    property=new Property(helper);
  }
  property.setPropertyName(propertyName);
  property.setElement(javaHasAnnotations);
  if (!helper.isAnnotationPresent(ptype,XmlTransient.class)) {
    property.setType(ptype);
  }
 else {
    JavaClass parent=ptype.getSuperclass();
    while (parent != null) {
      if (parent.getName().equals("String_Node_Str")) {
        property.setType(parent);
        break;
      }
      if (!helper.isAnnotationPresent(parent,XmlTransient.class)) {
        property.setType(parent);
        break;
      }
      parent=parent.getSuperclass();
    }
  }
  property.setSchemaName(getQNameForProperty(propertyName,javaHasAnnotations,getNamespaceInfoForPackage(cls),info.getClassNamespace()));
  processPropertyAnnotations(info,cls,javaHasAnnotations,property);
  ptype=property.getActualType();
  if (ptype.isPrimitive() || ptype.isArray() && ptype.getComponentType().isPrimitive()) {
    property.setIsRequired(true);
  }
  return property;
}