Program: 66501
Project: 66501
Buggy source:
public Project generateProject(ArrayList<JavaClass> typeInfoClasses,HashMap<String,TypeInfo> typeInfo,HashMap<String,QName> userDefinedSchemaTypes,HashMap<String,NamespaceInfo> packageToNamespaceMappings,HashMap<QName,ElementDeclaration> globalElements,List<ElementDeclaration> localElements,Map<TypeMappingInfo,Class> typeMappingInfoToGeneratedClass,Map<TypeMappingInfo,Class> typeMappingInfoToAdapterClasses,boolean isDefaultNamespaceAllowed) throws Exception {
  this.typeInfo=typeInfo;
  this.userDefinedSchemaTypes=userDefinedSchemaTypes;
  this.packageToNamespaceMappings=packageToNamespaceMappings;
  this.isDefaultNamespaceAllowed=isDefaultNamespaceAllowed;
  this.globalElements=globalElements;
  this.localElements=localElements;
  this.typeMappingInfoToGeneratedClasses=typeMappingInfoToGeneratedClass;
  this.typeMappingInfoToAdapterClasses=typeMappingInfoToAdapterClasses;
  project=new Project();
  for (  JavaClass next : typeInfoClasses) {
    if (!next.isEnum()) {
      generateDescriptor(next,project);
    }
  }
  for (  JavaClass next : typeInfoClasses) {
    if (!next.isEnum()) {
      setupInheritance(next);
    }
  }
  generateMappings();
  Set<Entry<String,TypeInfo>> entrySet=this.typeInfo.entrySet();
  for (  Entry<String,TypeInfo> entry : entrySet) {
    TypeInfo tInfo=entry.getValue();
    if (tInfo.getXmlCustomizer() != null) {
      String customizerClassName=tInfo.getXmlCustomizer();
      try {
        Class customizerClass=PrivilegedAccessHelper.getClassForName(customizerClassName);
        DescriptorCustomizer descriptorCustomizer=(DescriptorCustomizer)PrivilegedAccessHelper.newInstanceFromClass(customizerClass);
        descriptorCustomizer.customize(tInfo.getDescriptor());
      }
 catch (      IllegalAccessException iae) {
        throw JAXBException.couldNotCreateCustomizerInstance(iae,customizerClassName);
      }
catch (      InstantiationException ie) {
        throw JAXBException.couldNotCreateCustomizerInstance(ie,customizerClassName);
      }
catch (      ClassCastException cce) {
        throw JAXBException.invalidCustomizerClass(cce,customizerClassName);
      }
catch (      ClassNotFoundException cnfe) {
        throw JAXBException.couldNotCreateCustomizerInstance(cnfe,customizerClassName);
      }
    }
  }
  processGlobalElements(project);
  wrapperCounter=0;
  return project;
}

Fixed version (ground truth):
public Project generateProject(ArrayList<JavaClass> typeInfoClasses,HashMap<String,TypeInfo> typeInfo,HashMap<String,QName> userDefinedSchemaTypes,HashMap<String,NamespaceInfo> packageToNamespaceMappings,HashMap<QName,ElementDeclaration> globalElements,List<ElementDeclaration> localElements,Map<TypeMappingInfo,Class> typeMappingInfoToGeneratedClass,Map<TypeMappingInfo,Class> typeMappingInfoToAdapterClasses,boolean isDefaultNamespaceAllowed) throws Exception {
  this.typeInfo=typeInfo;
  this.userDefinedSchemaTypes=userDefinedSchemaTypes;
  this.packageToNamespaceMappings=packageToNamespaceMappings;
  this.isDefaultNamespaceAllowed=isDefaultNamespaceAllowed;
  this.globalElements=globalElements;
  this.localElements=localElements;
  this.typeMappingInfoToGeneratedClasses=typeMappingInfoToGeneratedClass;
  this.typeMappingInfoToAdapterClasses=typeMappingInfoToAdapterClasses;
  project=new Project();
  for (  JavaClass next : typeInfoClasses) {
    if (!next.isEnum()) {
      generateDescriptor(next,project);
    }
  }
  for (  JavaClass next : typeInfoClasses) {
    if (!next.isEnum()) {
      setupInheritance(next);
    }
  }
  generateMappings();
  Set<Entry<String,TypeInfo>> entrySet=this.typeInfo.entrySet();
  for (  Entry<String,TypeInfo> entry : entrySet) {
    TypeInfo tInfo=entry.getValue();
    if (tInfo.getXmlCustomizer() != null) {
      String customizerClassName=tInfo.getXmlCustomizer();
      try {
        Class customizerClass=PrivilegedAccessHelper.getClassForName(customizerClassName,true,helper.getClassLoader());
        DescriptorCustomizer descriptorCustomizer=(DescriptorCustomizer)PrivilegedAccessHelper.newInstanceFromClass(customizerClass);
        descriptorCustomizer.customize(tInfo.getDescriptor());
      }
 catch (      IllegalAccessException iae) {
        throw JAXBException.couldNotCreateCustomizerInstance(iae,customizerClassName);
      }
catch (      InstantiationException ie) {
        throw JAXBException.couldNotCreateCustomizerInstance(ie,customizerClassName);
      }
catch (      ClassCastException cce) {
        throw JAXBException.invalidCustomizerClass(cce,customizerClassName);
      }
catch (      ClassNotFoundException cnfe) {
        throw JAXBException.couldNotCreateCustomizerInstance(cnfe,customizerClassName);
      }
    }
  }
  processGlobalElements(project);
  wrapperCounter=0;
  return project;
}