Program: 177226
Project: 177226
Buggy source:
/** 
 * Getting the root model pulls all endpoint interfaces and schema types out of the source base, adds the classes specified to be included, and adds them to the model, then validates the model.
 * @return The root model.
 */
@Override protected EnunciateFreemarkerModel getRootModel() throws TemplateModelException {
  EnunciateFreemarkerModel model=(EnunciateFreemarkerModel)super.getRootModel();
  Collection<TypeDeclaration> typeDeclarations=getTypeDeclarations();
  for (  TypeDeclaration declaration : typeDeclarations) {
    if (isEndpointInterface(declaration)) {
      EndpointInterface endpointInterface=new EndpointInterface(declaration);
      if (isVerbose()) {
        System.out.println(declaration.getQualifiedName() + "String_Node_Str");
      }
      model.add(endpointInterface);
    }
 else     if (isRESTEndpoint(declaration)) {
      RESTEndpoint restEndpoint=new RESTEndpoint((ClassDeclaration)declaration);
      if (isVerbose()) {
        System.out.println(declaration.getQualifiedName() + "String_Node_Str");
      }
      model.add(restEndpoint);
    }
 else     if (isPotentialSchemaType(declaration)) {
      TypeDefinition typeDef=createTypeDefinition((ClassDeclaration)declaration);
      if (typeDef != null) {
        if (isVerbose()) {
          System.out.println(String.format("String_Node_Str",declaration.getQualifiedName(),typeDef.getClass().getSimpleName(),typeDef.getNamespace() == null ? "String_Node_Str" : typeDef.getNamespace(),typeDef.getName()));
        }
        model.add(typeDef);
        RootElementDeclaration rootElement=createRootElementDeclaration((ClassDeclaration)declaration,typeDef);
        if (rootElement != null) {
          if (isVerbose()) {
            System.out.println(declaration.getQualifiedName() + "String_Node_Str");
          }
          model.add(rootElement);
        }
      }
    }
  }
  for (  String ns : this.config.getNamespacesToPrefixes().keySet()) {
    model.getNamespacesToPrefixes().put(ns,this.config.getNamespacesToPrefixes().get(ns));
  }
  validate(model);
  return model;
}

Fixed version (ground truth):
/** 
 * Getting the root model pulls all endpoint interfaces and schema types out of the source base, adds the classes specified to be included, and adds them to the model, then validates the model.
 * @return The root model.
 */
@Override protected EnunciateFreemarkerModel getRootModel() throws TemplateModelException {
  EnunciateFreemarkerModel model=(EnunciateFreemarkerModel)super.getRootModel();
  AnnotationProcessorEnvironment env=Context.getCurrentEnvironment();
  Collection<TypeDeclaration> typeDeclarations=env.getTypeDeclarations();
  for (  TypeDeclaration declaration : typeDeclarations) {
    if (isEndpointInterface(declaration)) {
      EndpointInterface endpointInterface=new EndpointInterface(declaration);
      if (isVerbose()) {
        System.out.println(declaration.getQualifiedName() + "String_Node_Str");
      }
      model.add(endpointInterface);
    }
 else     if (isRESTEndpoint(declaration)) {
      RESTEndpoint restEndpoint=new RESTEndpoint((ClassDeclaration)declaration);
      if (isVerbose()) {
        System.out.println(declaration.getQualifiedName() + "String_Node_Str");
      }
      model.add(restEndpoint);
    }
 else     if (isPotentialSchemaType(declaration)) {
      TypeDefinition typeDef=createTypeDefinition((ClassDeclaration)declaration);
      loadTypeDef(typeDef,model);
    }
  }
  for (  String jaxbClassImport : this.config.getJaxbClassImports()) {
    TypeDeclaration typeDeclaration=env.getTypeDeclaration(jaxbClassImport);
    if (typeDeclaration == null) {
      throw new IllegalStateException("String_Node_Str" + jaxbClassImport);
    }
    if (!(typeDeclaration instanceof ClassDeclaration)) {
      throw new IllegalStateException("String_Node_Str" + jaxbClassImport);
    }
    TypeDefinition typeDef=createTypeDefinition((ClassDeclaration)typeDeclaration);
    loadTypeDef(typeDef,model);
  }
  for (  String ns : this.config.getNamespacesToPrefixes().keySet()) {
    model.getNamespacesToPrefixes().put(ns,this.config.getNamespacesToPrefixes().get(ns));
  }
  validate(model);
  return model;
}