Program: 67309
Project: 67309
Buggy source:
public void processClassesAndProperties(JavaClass[] classes){
  typeInfoClasses=new ArrayList<JavaClass>();
  typeInfo=new HashMap<String,TypeInfo>();
  typeQNames=new ArrayList<QName>();
  userDefinedSchemaTypes=new HashMap<String,QName>();
  packageToNamespaceMappings=new HashMap<String,NamespaceInfo>();
  this.factoryMethods=new HashMap<String,JavaMethod>();
  this.namespaceResolver=new NamespaceResolver();
  this.xmlRootElements=new HashMap<String,ElementDeclaration>();
  xmlIdRefProps=new ArrayList<Property>();
  arrayClassesToGeneratedClasses=new HashMap<String,Class>();
  collectionClassesToGeneratedClasses=new HashMap<java.lang.reflect.Type,Class>();
  generatedClassesToArrayClasses=new HashMap<Class,JavaClass>();
  generatedClassesToCollectionClasses=new HashMap<Class,java.lang.reflect.Type>();
  ArrayList<JavaClass> extraClasses=new ArrayList<JavaClass>();
  ArrayList<JavaClass> classesToProcess=new ArrayList<JavaClass>();
  for (  JavaClass javaClass : classes) {
    if (javaClass.isArray()) {
      if (!helper.isBuiltInJavaType(javaClass.getComponentType())) {
        extraClasses.add(javaClass.getComponentType());
      }
      Class generatedClass=generateWrapperForArrayClass(javaClass);
      extraClasses.add(helper.getJavaClass(generatedClass));
      arrayClassesToGeneratedClasses.put(javaClass.getRawName(),generatedClass);
      generatedClassesToArrayClasses.put(generatedClass,javaClass);
    }
 else     if (isCollectionType(javaClass)) {
      JavaClass componentClass;
      if (javaClass.hasActualTypeArguments()) {
        componentClass=(JavaClass)javaClass.getActualTypeArguments().toArray()[0];
        if (!componentClass.isPrimitive()) {
          extraClasses.add(componentClass);
        }
      }
 else {
        componentClass=helper.getJavaClass(Object.class);
      }
      if (javaClassToType != null) {
        java.lang.reflect.Type theType=javaClassToType.get(javaClass);
        if (theType != null) {
          Class generatedClass=generateWrapperForArrayClass(javaClass);
          collectionClassesToGeneratedClasses.put(theType,generatedClass);
          generatedClassesToCollectionClasses.put(generatedClass,theType);
          extraClasses.add(helper.getJavaClass(generatedClass));
        }
      }
    }
 else     if (isMapType(javaClass)) {
      JavaClass keyClass;
      JavaClass valueClass;
      if (javaClass.hasActualTypeArguments()) {
        keyClass=(JavaClass)javaClass.getActualTypeArguments().toArray()[0];
        if (!helper.isBuiltInJavaType(keyClass)) {
          extraClasses.add(keyClass);
        }
        valueClass=(JavaClass)javaClass.getActualTypeArguments().toArray()[1];
        if (!helper.isBuiltInJavaType(valueClass)) {
          extraClasses.add(valueClass);
        }
      }
 else {
        keyClass=helper.getJavaClass(Object.class);
        valueClass=helper.getJavaClass(Object.class);
      }
      if (javaClassToType != null) {
        java.lang.reflect.Type theType=javaClassToType.get(javaClass);
        if (theType != null) {
          Class generatedClass=generateWrapperForMapClass(javaClass,keyClass,valueClass);
          collectionClassesToGeneratedClasses.put(theType,generatedClass);
          extraClasses.add(helper.getJavaClass(generatedClass));
        }
      }
    }
 else {
      processClass(javaClass,classesToProcess);
    }
  }
  for (  JavaClass javaClass : extraClasses) {
    processClass(javaClass,classesToProcess);
  }
  updateGlobalElements(classesToProcess);
  for (  JavaClass javaClass : classesToProcess) {
    if (javaClass == null) {
      continue;
    }
    createTypeInfoFor(javaClass);
  }
  checkForCallbackMethods();
  for (  Property property : xmlIdRefProps) {
    JavaClass typeClass=property.getType();
    if (typeClass.isArray()) {
      typeClass=typeClass.getComponentType();
    }
 else     if (isCollectionType(typeClass)) {
      typeClass=property.getGenericType();
    }
    TypeInfo tInfo=typeInfo.get(typeClass.getQualifiedName());
    if (tInfo != null && tInfo.getIDProperty() == null) {
      throw JAXBException.invalidIdRef(property.getPropertyName(),typeClass.getQualifiedName());
    }
  }
}

Fixed version (ground truth):
/** 
 * Generate TypeInfo instances for a given array of JavaClasses.
 * @param classes
 */
public void processClassesAndProperties(JavaClass[] classes){
  init();
  preBuildTypeInfo(classes);
  classes=postBuildTypeInfo(classes);
  processJavaClasses(classes);
}