Program: 63650
Project: 63650
Buggy source:
/** 
 * Process class level annotations only. It is assumed that a call to init() has been made prior to calling this method. After the types created via this method have been modified (if necessary) postBuildTypeInfo and processJavaClasses should be called to finish processing.
 * @param javaClasses
 * @return
 */
public Map<String,TypeInfo> preBuildTypeInfo(JavaClass[] javaClasses){
  for (  JavaClass javaClass : javaClasses) {
    if (javaClass == null || !shouldGenerateTypeInfo(javaClass) || isXmlRegistry(javaClass) || javaClass.isArray()) {
      continue;
    }
    String qualifiedName=javaClass.getQualifiedName();
    TypeInfo info=typeInfo.get(qualifiedName);
    if (info != null) {
      if (info.isPreBuilt()) {
        continue;
      }
    }
    if (javaClass.isEnum()) {
      info=new EnumTypeInfo(helper);
    }
 else {
      info=new TypeInfo(helper);
    }
    info.setJavaClassName(qualifiedName);
    info.setPreBuilt(true);
    if (helper.isAnnotationPresent(javaClass,XmlTransient.class)) {
      info.setXmlTransient(true);
    }
    processXmlExtensible(javaClass,info);
    if (helper.isAnnotationPresent(javaClass,XmlInlineBinaryData.class)) {
      info.setInlineBinaryData(true);
    }
    processNamedObjectGraphs(javaClass,info);
    processXmlRootElement(javaClass,info);
    processXmlSeeAlso(javaClass,info);
    PackageInfo packageInfo=getPackageInfoForPackage(javaClass);
    if (packageInfo != null && packageInfo.getPackageLevelAdaptersByClass().size() > 0) {
      for (      String adapterClass : packageInfo.getPackageLevelAdaptersByClass().keySet()) {
        JavaClass boundType=packageInfo.getPackageLevelAdaptersByClass().get(adapterClass);
        info.getPackageLevelAdaptersByClass().put(adapterClass,boundType);
      }
    }
    NamespaceInfo namespaceInfo=packageInfo.getNamespaceInfo();
    preProcessXmlType(javaClass,info,namespaceInfo);
    preProcessXmlAccessorType(javaClass,info,namespaceInfo);
    preProcessXmlAccessorOrder(javaClass,info,namespaceInfo);
    processPackageLevelAdapters(javaClass,info);
    processAccessorFactory(javaClass,info);
    processClassLevelAdapters(javaClass,info);
    preProcessCustomizer(javaClass,info);
    processSchemaTypes(javaClass,info);
    if (helper.isAnnotationPresent(javaClass,XmlClassExtractor.class)) {
      XmlClassExtractor classExtractor=(XmlClassExtractor)helper.getAnnotation(javaClass,XmlClassExtractor.class);
      info.setClassExtractorName(classExtractor.value().getName());
    }
    if (helper.isAnnotationPresent(javaClass,XmlProperties.class)) {
      XmlProperties xmlProperties=(XmlProperties)helper.getAnnotation(javaClass,XmlProperties.class);
      Map<Object,Object> propertiesMap=createUserPropertiesMap(xmlProperties.value());
      info.setUserProperties(propertiesMap);
    }
 else     if (helper.isAnnotationPresent(javaClass,XmlProperty.class)) {
      XmlProperty xmlProperty=(XmlProperty)helper.getAnnotation(javaClass,XmlProperty.class);
      Map<Object,Object> propertiesMap=createUserPropertiesMap(new XmlProperty[]{xmlProperty});
      info.setUserProperties(propertiesMap);
    }
    if (helper.isAnnotationPresent(javaClass,XmlDiscriminatorNode.class)) {
      XmlDiscriminatorNode xmlDiscriminatorNode=(XmlDiscriminatorNode)helper.getAnnotation(javaClass,XmlDiscriminatorNode.class);
      info.setXmlDiscriminatorNode(xmlDiscriminatorNode.value());
    }
    if (helper.isAnnotationPresent(javaClass,XmlDiscriminatorValue.class)) {
      XmlDiscriminatorValue xmlDiscriminatorValue=(XmlDiscriminatorValue)helper.getAnnotation(javaClass,XmlDiscriminatorValue.class);
      info.setXmlDiscriminatorValue(xmlDiscriminatorValue.value());
    }
    typeInfoClasses.add(javaClass);
    typeInfo.put(info.getJavaClassName(),info);
  }
  return typeInfo;
}

Fixed version (ground truth):
/** 
 * Process class level annotations only. It is assumed that a call to init() has been made prior to calling this method. After the types created via this method have been modified (if necessary) postBuildTypeInfo and processJavaClasses should be called to finish processing.
 * @param javaClasses
 * @return
 */
public Map<String,TypeInfo> preBuildTypeInfo(JavaClass[] javaClasses){
  for (  JavaClass javaClass : javaClasses) {
    String qualifiedName=javaClass.getQualifiedName();
    TypeInfo info=typeInfo.get(qualifiedName);
    if (javaClass == null || javaClass.isArray() || (info != null && info.isPreBuilt()) || !shouldGenerateTypeInfo(javaClass) || isXmlRegistry(javaClass)) {
      continue;
    }
    if (javaClass.isEnum()) {
      info=new EnumTypeInfo(helper,javaClass);
    }
 else {
      info=new TypeInfo(helper,javaClass);
    }
    info.setJavaClassName(qualifiedName);
    info.setPreBuilt(true);
    if (helper.isAnnotationPresent(javaClass,XmlTransient.class)) {
      info.setXmlTransient(true);
    }
    processXmlExtensible(javaClass,info);
    if (helper.isAnnotationPresent(javaClass,XmlInlineBinaryData.class)) {
      info.setInlineBinaryData(true);
    }
    processNamedObjectGraphs(javaClass,info);
    processXmlRootElement(javaClass,info);
    processXmlSeeAlso(javaClass,info);
    PackageInfo packageInfo=getPackageInfoForPackage(javaClass);
    if (packageInfo != null && packageInfo.getPackageLevelAdaptersByClass().size() > 0) {
      for (      String adapterClass : packageInfo.getPackageLevelAdaptersByClass().keySet()) {
        JavaClass boundType=packageInfo.getPackageLevelAdaptersByClass().get(adapterClass);
        info.getPackageLevelAdaptersByClass().put(adapterClass,boundType);
      }
    }
    NamespaceInfo namespaceInfo=packageInfo.getNamespaceInfo();
    preProcessXmlType(javaClass,info,namespaceInfo);
    preProcessXmlAccessorType(javaClass,info,namespaceInfo);
    preProcessXmlAccessorOrder(javaClass,info,namespaceInfo);
    processPackageLevelAdapters(javaClass,info);
    processAccessorFactory(javaClass,info);
    processClassLevelAdapters(javaClass,info);
    preProcessCustomizer(javaClass,info);
    processSchemaTypes(javaClass,info);
    if (helper.isAnnotationPresent(javaClass,XmlClassExtractor.class)) {
      XmlClassExtractor classExtractor=(XmlClassExtractor)helper.getAnnotation(javaClass,XmlClassExtractor.class);
      info.setClassExtractorName(classExtractor.value().getName());
    }
    if (helper.isAnnotationPresent(javaClass,XmlProperties.class)) {
      XmlProperties xmlProperties=(XmlProperties)helper.getAnnotation(javaClass,XmlProperties.class);
      Map<Object,Object> propertiesMap=createUserPropertiesMap(xmlProperties.value());
      info.setUserProperties(propertiesMap);
    }
 else     if (helper.isAnnotationPresent(javaClass,XmlProperty.class)) {
      XmlProperty xmlProperty=(XmlProperty)helper.getAnnotation(javaClass,XmlProperty.class);
      Map<Object,Object> propertiesMap=createUserPropertiesMap(new XmlProperty[]{xmlProperty});
      info.setUserProperties(propertiesMap);
    }
    if (helper.isAnnotationPresent(javaClass,XmlDiscriminatorNode.class)) {
      XmlDiscriminatorNode xmlDiscriminatorNode=(XmlDiscriminatorNode)helper.getAnnotation(javaClass,XmlDiscriminatorNode.class);
      info.setXmlDiscriminatorNode(xmlDiscriminatorNode.value());
    }
    if (helper.isAnnotationPresent(javaClass,XmlDiscriminatorValue.class)) {
      XmlDiscriminatorValue xmlDiscriminatorValue=(XmlDiscriminatorValue)helper.getAnnotation(javaClass,XmlDiscriminatorValue.class);
      info.setXmlDiscriminatorValue(xmlDiscriminatorValue.value());
    }
    typeInfoClasses.add(javaClass);
    typeInfo.put(info.getJavaClassName(),info);
  }
  return typeInfo;
}