Program: 67218
Project: 67218
Buggy source:
/** 
 * Process XmlBindings on a per package basis for a given AnnotationsPorcessor instance.
 * @param annotationsProcessor
 */
public void processXML(AnnotationsProcessor annotationsProcessor,JavaModelInput jModelInput){
  this.jModelInput=jModelInput;
  this.aProcessor=annotationsProcessor;
  XmlBindings xmlBindings;
  for (  String packageName : xmlBindingMap.keySet()) {
    xmlBindings=xmlBindingMap.get(packageName);
    NamespaceInfo nsInfo=processXmlSchema(xmlBindings,packageName);
    if (nsInfo != null) {
      annotationsProcessor.addPackageToNamespaceMapping(packageName,nsInfo);
    }
    JavaClass[] javaClasses=getClassesToProcess(xmlBindings);
    annotationsProcessor.init();
    Map<String,TypeInfo> typeInfoMap=annotationsProcessor.preBuildTypeInfo(javaClasses);
    nsInfo=annotationsProcessor.getPackageToNamespaceMappings().get(packageName);
    JavaTypes jTypes=xmlBindings.getJavaTypes();
    if (jTypes != null) {
      for (      JavaType javaType : jTypes.getJavaType()) {
        TypeInfo info=typeInfoMap.get(javaType.getName());
        if (javaType.getXmlJavaTypeAdapter() != null) {
          info.setXmlJavaTypeAdapter(javaType.getXmlJavaTypeAdapter());
        }
        if (javaType.isSetXmlAccessorOrder()) {
          info.setXmlAccessOrder(javaType.getXmlAccessorOrder());
        }
 else         if (!info.isSetXmlAccessOrder()) {
          if (xmlBindings.isSetXmlAccessorOrder()) {
            info.setXmlAccessOrder(xmlBindings.getXmlAccessorOrder());
          }
 else {
            info.setXmlAccessOrder(nsInfo.getAccessOrder());
          }
        }
        if (javaType.isSetXmlAccessorType()) {
          info.setXmlAccessType(javaType.getXmlAccessorType());
        }
 else         if (!info.isSetXmlAccessType()) {
          if (xmlBindings.isSetXmlAccessorType()) {
            info.setXmlAccessType(xmlBindings.getXmlAccessorType());
          }
 else {
            info.setXmlAccessType(nsInfo.getAccessType());
          }
        }
        if (javaType.isSetXmlTransient()) {
          info.setXmlTransient(javaType.isXmlTransient());
        }
        if (javaType.getXmlRootElement() != null) {
          info.setXmlRootElement(javaType.getXmlRootElement());
        }
        if (javaType.getXmlSeeAlso() != null && javaType.getXmlSeeAlso().size() > 0) {
          info.setXmlSeeAlso(javaType.getXmlSeeAlso());
        }
        if (javaType.getXmlType() != null) {
          info.setXmlType(javaType.getXmlType());
        }
      }
    }
    if (xmlBindings.getXmlJavaTypeAdapters() != null) {
      Map<String,TypeInfo> typeInfos=aProcessor.getTypeInfosForPackage(packageName);
      for (      TypeInfo tInfo : typeInfos.values()) {
        List<XmlJavaTypeAdapter> adapters=xmlBindings.getXmlJavaTypeAdapters().getXmlJavaTypeAdapter();
        for (        XmlJavaTypeAdapter xja : adapters) {
          JavaClass adapterClass=jModelInput.getJavaModel().getClass(xja.getValue());
          JavaClass boundType=jModelInput.getJavaModel().getClass(xja.getType());
          if (boundType != null) {
            tInfo.addAdapterClass(adapterClass,boundType);
          }
        }
      }
    }
    javaClasses=annotationsProcessor.postBuildTypeInfo(javaClasses);
    annotationsProcessor.processJavaClasses(javaClasses);
    Map<String,TypeInfo> typeInfosForPackage=annotationsProcessor.getTypeInfosForPackage(packageName);
    jTypes=xmlBindings.getJavaTypes();
    if (jTypes != null) {
      for (      JavaType javaType : jTypes.getJavaType()) {
        TypeInfo typeInfo=typeInfosForPackage.get(javaType.getName());
        if (javaType != null) {
          processJavaType(javaType,typeInfo,nsInfo);
        }
      }
    }
  }
  for (  String key : aProcessor.getTypeInfo().keySet()) {
    JavaClass[] jClassArray;
    TypeInfo tInfo=aProcessor.getTypeInfo().get(key);
    for (    Property prop : tInfo.getPropertyList()) {
      if (prop.isSetXmlJavaTypeAdapter()) {
        jClassArray=new JavaClass[]{prop.getActualType()};
        aProcessor.buildNewTypeInfo(jClassArray);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Process XmlBindings on a per package basis for a given AnnotationsPorcessor instance.
 * @param annotationsProcessor
 */
public void processXML(AnnotationsProcessor annotationsProcessor,JavaModelInput jModelInput){
  this.jModelInput=jModelInput;
  this.aProcessor=annotationsProcessor;
  XmlBindings xmlBindings;
  for (  String packageName : xmlBindingMap.keySet()) {
    xmlBindings=xmlBindingMap.get(packageName);
    NamespaceInfo nsInfo=processXmlSchema(xmlBindings,packageName);
    if (nsInfo != null) {
      annotationsProcessor.addPackageToNamespaceMapping(packageName,nsInfo);
    }
    JavaClass[] javaClasses=getClassesToProcess(xmlBindings);
    annotationsProcessor.init();
    Map<String,TypeInfo> typeInfoMap=annotationsProcessor.preBuildTypeInfo(javaClasses);
    nsInfo=annotationsProcessor.getPackageToNamespaceMappings().get(packageName);
    JavaTypes jTypes=xmlBindings.getJavaTypes();
    if (jTypes != null) {
      for (      JavaType javaType : jTypes.getJavaType()) {
        TypeInfo info=typeInfoMap.get(javaType.getName());
        if (javaType.getXmlJavaTypeAdapter() != null) {
          info.setXmlJavaTypeAdapter(javaType.getXmlJavaTypeAdapter());
        }
        if (javaType.isSetXmlAccessorOrder()) {
          info.setXmlAccessOrder(javaType.getXmlAccessorOrder());
        }
 else         if (!info.isSetXmlAccessOrder()) {
          if (xmlBindings.isSetXmlAccessorOrder()) {
            info.setXmlAccessOrder(xmlBindings.getXmlAccessorOrder());
          }
 else {
            info.setXmlAccessOrder(nsInfo.getAccessOrder());
          }
        }
        if (javaType.isSetXmlAccessorType()) {
          info.setXmlAccessType(javaType.getXmlAccessorType());
        }
 else         if (!info.isSetXmlAccessType()) {
          if (xmlBindings.isSetXmlAccessorType()) {
            info.setXmlAccessType(xmlBindings.getXmlAccessorType());
          }
 else {
            info.setXmlAccessType(nsInfo.getAccessType());
          }
        }
        if (javaType.isSetXmlTransient()) {
          info.setXmlTransient(javaType.isXmlTransient());
        }
        if (javaType.getXmlRootElement() != null) {
          info.setXmlRootElement(javaType.getXmlRootElement());
        }
        if (javaType.getXmlSeeAlso() != null && javaType.getXmlSeeAlso().size() > 0) {
          info.setXmlSeeAlso(javaType.getXmlSeeAlso());
        }
        if (javaType.getXmlType() != null) {
          info.setXmlType(javaType.getXmlType());
        }
      }
    }
    if (xmlBindings.getXmlJavaTypeAdapters() != null) {
      Map<String,TypeInfo> typeInfos=aProcessor.getTypeInfosForPackage(packageName);
      for (      TypeInfo tInfo : typeInfos.values()) {
        List<XmlJavaTypeAdapter> adapters=xmlBindings.getXmlJavaTypeAdapters().getXmlJavaTypeAdapter();
        for (        XmlJavaTypeAdapter xja : adapters) {
          JavaClass adapterClass=jModelInput.getJavaModel().getClass(xja.getValue());
          JavaClass boundType=jModelInput.getJavaModel().getClass(xja.getType());
          if (boundType != null) {
            tInfo.addAdapterClass(adapterClass,boundType);
          }
        }
      }
    }
    javaClasses=annotationsProcessor.postBuildTypeInfo(javaClasses);
    annotationsProcessor.processJavaClasses(javaClasses);
    Map<String,TypeInfo> typeInfosForPackage=annotationsProcessor.getTypeInfosForPackage(packageName);
    jTypes=xmlBindings.getJavaTypes();
    if (jTypes != null) {
      for (      JavaType javaType : jTypes.getJavaType()) {
        TypeInfo typeInfo=typeInfosForPackage.get(javaType.getName());
        if (javaType != null) {
          processJavaType(javaType,typeInfo,nsInfo);
        }
      }
    }
  }
  Map<String,TypeInfo> typeInfos=(Map<String,TypeInfo>)aProcessor.getTypeInfo().clone();
  for (  String key : typeInfos.keySet()) {
    JavaClass[] jClassArray;
    TypeInfo tInfo=typeInfos.get(key);
    for (    Property prop : tInfo.getPropertyList()) {
      if (prop.isSetXmlJavaTypeAdapter()) {
        jClassArray=new JavaClass[]{prop.getActualType()};
        aProcessor.buildNewTypeInfo(jClassArray);
      }
    }
  }
}