Program: 65316
Project: 65316
Buggy source:
public void build(OutputStream dbwsSchemaStream,OutputStream dbwsSessionsStream,OutputStream dbwsServiceStream,OutputStream dbwsOrStream,OutputStream dbwsOxStream,OutputStream swarefStream,OutputStream webXmlStream,OutputStream wsdlStream,OutputStream classProviderStream,OutputStream sourceProviderStream,OutputStream classProviderListenerStream,OutputStream sourceProviderListenerStream,Logger logger) throws WSDLException {
  this.logger=logger;
  xrServiceModel.setName(getProjectName());
  String sessionsFileName=getSessionsFileName();
  if (sessionsFileName != null && sessionsFileName.length() > 0) {
    xrServiceModel.setSessionsFile(sessionsFileName);
  }
  if (topTransformer == null) {
    ServiceLoader<NamingConventionTransformer> transformers=ServiceLoader.load(NamingConventionTransformer.class);
    Iterator<NamingConventionTransformer> transformerIter=transformers.iterator();
    topTransformer=transformerIter.next();
    LinkedList<NamingConventionTransformer> transformerList=new LinkedList<NamingConventionTransformer>();
    if (!((DefaultNamingConventionTransformer)topTransformer).isDefaultTransformer()) {
      for (; transformerIter.hasNext(); ) {
        NamingConventionTransformer nextTransformer=transformerIter.next();
        if (!((DefaultNamingConventionTransformer)nextTransformer).isDefaultTransformer()) {
          transformerList.addLast(nextTransformer);
        }
 else         if (nextTransformer instanceof SQLX2003Transformer) {
          transformerList.addLast(nextTransformer);
        }
      }
    }
 else {
      for (; transformerIter.hasNext(); ) {
        transformerList.addLast(transformerIter.next());
      }
    }
    NamingConventionTransformer nextTransformer=topTransformer;
    for (Iterator<NamingConventionTransformer> i=transformerList.iterator(); i.hasNext(); ) {
      NamingConventionTransformer nct=i.next();
      ((DefaultNamingConventionTransformer)nextTransformer).setNextTransformer(nct);
      nextTransformer=nct;
    }
  }
  packager.start();
  DBWSBuilderHelper helper=getBuilderHelper();
  helper.buildDbArtifacts();
  helper.buildOROXProjects(topTransformer);
  helper.buildSchema(topTransformer);
  helper.buildSessionsXML(dbwsSessionsStream);
  packager.setHasAttachments(hasAttachments());
  helper.buildDBWSModel(topTransformer,dbwsServiceStream);
  helper.writeAttachmentSchema(swarefStream);
  helper.buildWSDL(wsdlStream,topTransformer);
  helper.writeWebXML(webXmlStream);
  helper.generateDBWSProvider(sourceProviderStream,classProviderStream,sourceProviderListenerStream,classProviderListenerStream);
  helper.writeSchema(dbwsSchemaStream);
  helper.writeOROXProjects(dbwsOrStream,dbwsOxStream);
  packager.end();
}

Fixed version (ground truth):
public void build(OutputStream dbwsSchemaStream,OutputStream dbwsSessionsStream,OutputStream dbwsServiceStream,OutputStream dbwsOrStream,OutputStream dbwsOxStream,OutputStream swarefStream,OutputStream webXmlStream,OutputStream wsdlStream,OutputStream classProviderStream,OutputStream sourceProviderStream,OutputStream classProviderListenerStream,OutputStream sourceProviderListenerStream,Logger logger) throws WSDLException {
  this.logger=logger;
  xrServiceModel.setName(getProjectName());
  String sessionsFileName=getSessionsFileName();
  if (sessionsFileName != null && sessionsFileName.length() > 0) {
    xrServiceModel.setSessionsFile(sessionsFileName);
  }
  if (topTransformer == null) {
    ServiceLoader<NamingConventionTransformer> transformers=ServiceLoader.load(NamingConventionTransformer.class);
    Iterator<NamingConventionTransformer> transformerIter=transformers.iterator();
    topTransformer=transformerIter.next();
    LinkedList<NamingConventionTransformer> transformerList=new LinkedList<NamingConventionTransformer>();
    if (!((DefaultNamingConventionTransformer)topTransformer).isDefaultTransformer()) {
      for (; transformerIter.hasNext(); ) {
        NamingConventionTransformer nextTransformer=transformerIter.next();
        if (!((DefaultNamingConventionTransformer)nextTransformer).isDefaultTransformer()) {
          transformerList.addLast(nextTransformer);
        }
 else         if (nextTransformer instanceof SQLX2003Transformer) {
          transformerList.addLast(nextTransformer);
        }
      }
    }
 else {
      for (; transformerIter.hasNext(); ) {
        transformerList.addLast(transformerIter.next());
      }
    }
    NamingConventionTransformer nextTransformer=topTransformer;
    for (Iterator<NamingConventionTransformer> i=transformerList.iterator(); i.hasNext(); ) {
      NamingConventionTransformer nct=i.next();
      ((DefaultNamingConventionTransformer)nextTransformer).setNextTransformer(nct);
      nextTransformer=nct;
    }
  }
  packager.start();
  DBWSBuilderHelper helper=getBuilderHelper();
  helper.buildDbArtifacts();
  helper.buildOROXProjects(topTransformer,helper.buildTypesList(operations));
  helper.buildSchema(topTransformer);
  helper.buildSessionsXML(dbwsSessionsStream);
  packager.setHasAttachments(hasAttachments());
  helper.buildDBWSModel(topTransformer,dbwsServiceStream);
  helper.writeAttachmentSchema(swarefStream);
  helper.buildWSDL(wsdlStream,topTransformer);
  helper.writeWebXML(webXmlStream);
  helper.generateDBWSProvider(sourceProviderStream,classProviderStream,sourceProviderListenerStream,classProviderListenerStream);
  helper.writeSchema(dbwsSchemaStream);
  helper.writeOROXProjects(dbwsOrStream,dbwsOxStream);
  packager.end();
}