Program: 69360
Project: 69360
Buggy source:
@Override public void prepare(HttpServletResponse hres){
  translator=Util.createPackageTranslator(QTI21ResultsExportMediaResource.class,hres.getLocale());
  String label=StringHelper.transformDisplayNameToFileSystemName(title);
  if (label != null && !label.toLowerCase().endsWith("String_Node_Str")) {
    label+="String_Node_Str";
  }
  String urlEncodedLabel=StringHelper.urlEncodeUTF8(label);
  hres.setHeader("String_Node_Str","String_Node_Str" + urlEncodedLabel);
  hres.setHeader("String_Node_Str",urlEncodedLabel);
  try (ZipOutputStream zout=new ZipOutputStream(hres.getOutputStream())){
    zout.setLevel(9);
    List<AssessedMember> assessedMembers=new ArrayList<AssessedMember>();
    for (    Identity identity : identities) {
      String idDir=DATA + identity.getName();
      idDir=idDir.endsWith(SEP) ? idDir : idDir + SEP;
      createZipDirectory(zout,idDir);
      String userName=identity.getName();
      String firstName=identity.getUser().getProperty(UserConstants.FIRSTNAME,null);
      String lastName=identity.getUser().getProperty(UserConstants.LASTNAME,null);
      String memberEmail=identity.getUser().getProperty(UserConstants.EMAIL,null);
      AssessedMember assessedMember=new AssessedMember(userName,lastName,firstName,memberEmail,null);
      List<AssessmentTestSession> sessions=qtiService.getAssessmentTestSessions(entry,courseNode.getIdent(),identity);
      List<ResultDetail> assessments=new ArrayList<ResultDetail>();
      for (      AssessmentTestSession session : sessions) {
        Long assessmentID=session.getKey();
        String idPath=idDir + translator.translate("String_Node_Str") + (sessions.indexOf(session) + 1)+ SEP;
        createZipDirectory(zout,idPath);
        ResultDetail resultDetail=new ResultDetail(assessmentID.toString(),assessmentDateFormat.format(session.getCreationDate()),displayDateFormat.format(new Date(session.getDuration())),session.getScore().floatValue(),createPassedIcons(session.getPassed() == null ? true : session.getPassed()),idPath.replace(idDir,"String_Node_Str") + assessmentID + "String_Node_Str");
        assessments.add(resultDetail);
        WindowControl mockwControl=new WindowControlMocker();
        FileResourceManager frm=FileResourceManager.getInstance();
        File fUnzippedDirRoot=frm.unzipFileResource(session.getTestEntry().getOlatResource());
        Controller assessmentResultController=new AssessmentResultController(ureq,mockwControl,identity,false,session,ShowResultsOnFinish.details,fUnzippedDirRoot,null);
        Component component=assessmentResultController.getInitialComponent();
        String componentHTML=createResultHTML(component);
        convertToZipEntry(zout,idPath + assessmentID + "String_Node_Str",componentHTML);
        File resultXML=qtiService.getAssessmentResultFile(session);
        convertToZipEntry(zout,idPath + assessmentID + "String_Node_Str",resultXML);
      }
      String singleUserInfoHTML=createResultListingHTML(assessments,assessedMember);
      convertToZipEntry(zout,DATA + identity.getName() + "String_Node_Str",singleUserInfoHTML);
      String linkToUser=idDir.replace("String_Node_Str","String_Node_Str") + "String_Node_Str";
      AssessedMember member=new AssessedMember();
      member.setUsername(createLink(identity.getName(),linkToUser,false));
      member.setLastname(createLink(identity.getUser().getProperty(UserConstants.LASTNAME,null),linkToUser,false));
      member.setFirstname(createLink(identity.getUser().getProperty(UserConstants.FIRSTNAME,null),linkToUser,false));
      member.setTries(String.valueOf(sessions.size()));
      assessedMembers.add(member);
    }
    String membersHTML=createMemberListingHTML(assessedMembers);
    convertToZipEntry(zout,"String_Node_Str",membersHTML);
    File sasstheme=new File(WebappHelper.getContextRealPath("String_Node_Str"));
    fsToZip(zout,sasstheme.toPath(),"String_Node_Str");
    File fontawesome=new File(WebappHelper.getContextRealPath("String_Node_Str"));
    fsToZip(zout,fontawesome.toPath(),"String_Node_Str");
    zout.close();
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void prepare(HttpServletResponse hres){
  translator=Util.createPackageTranslator(QTI21ResultsExportMediaResource.class,hres.getLocale());
  String label=StringHelper.transformDisplayNameToFileSystemName(title);
  if (label != null && !label.toLowerCase().endsWith("String_Node_Str")) {
    label+="String_Node_Str";
  }
  String urlEncodedLabel=StringHelper.urlEncodeUTF8(label);
  hres.setHeader("String_Node_Str","String_Node_Str" + urlEncodedLabel);
  hres.setHeader("String_Node_Str",urlEncodedLabel);
  try (ZipOutputStream zout=new ZipOutputStream(hres.getOutputStream())){
    zout.setLevel(9);
    List<AssessedMember> assessedMembers=new ArrayList<AssessedMember>();
    for (    Identity identity : identities) {
      String idDir=DATA + identity.getName();
      idDir=idDir.endsWith(SEP) ? idDir : idDir + SEP;
      createZipDirectory(zout,idDir);
      String userName=identity.getName();
      String firstName=identity.getUser().getProperty(UserConstants.FIRSTNAME,null);
      String lastName=identity.getUser().getProperty(UserConstants.LASTNAME,null);
      String memberEmail=identity.getUser().getProperty(UserConstants.EMAIL,null);
      AssessedMember assessedMember=new AssessedMember(userName,lastName,firstName,memberEmail,null);
      List<AssessmentTestSession> sessions=qtiService.getAssessmentTestSessions(entry,courseNode.getIdent(),identity);
      List<ResultDetail> assessments=new ArrayList<ResultDetail>();
      for (      AssessmentTestSession session : sessions) {
        Long assessmentID=session.getKey();
        String idPath=idDir + translator.translate("String_Node_Str") + (sessions.indexOf(session) + 1)+ SEP;
        createZipDirectory(zout,idPath);
        ResultDetail resultDetail=new ResultDetail(assessmentID.toString(),assessmentDateFormat.format(session.getCreationDate()),displayDateFormat.format(new Date(session.getDuration())),session.getScore().floatValue(),createPassedIcons(session.getPassed() == null ? true : session.getPassed()),idPath.replace(idDir,"String_Node_Str") + assessmentID + "String_Node_Str");
        assessments.add(resultDetail);
        WindowControl mockwControl=new WindowControlMocker();
        FileResourceManager frm=FileResourceManager.getInstance();
        File fUnzippedDirRoot=frm.unzipFileResource(session.getTestEntry().getOlatResource());
        Controller assessmentResultController=new AssessmentResultController(ureq,mockwControl,identity,false,session,ShowResultsOnFinish.details,fUnzippedDirRoot,null,false);
        Component component=assessmentResultController.getInitialComponent();
        String componentHTML=createResultHTML(component);
        convertToZipEntry(zout,idPath + assessmentID + "String_Node_Str",componentHTML);
        File resultXML=qtiService.getAssessmentResultFile(session);
        convertToZipEntry(zout,idPath + assessmentID + "String_Node_Str",resultXML);
      }
      String singleUserInfoHTML=createResultListingHTML(assessments,assessedMember);
      convertToZipEntry(zout,DATA + identity.getName() + "String_Node_Str",singleUserInfoHTML);
      String linkToUser=idDir.replace("String_Node_Str","String_Node_Str") + "String_Node_Str";
      AssessedMember member=new AssessedMember();
      member.setUsername(createLink(identity.getName(),linkToUser,false));
      member.setLastname(createLink(identity.getUser().getProperty(UserConstants.LASTNAME,null),linkToUser,false));
      member.setFirstname(createLink(identity.getUser().getProperty(UserConstants.FIRSTNAME,null),linkToUser,false));
      member.setTries(String.valueOf(sessions.size()));
      assessedMembers.add(member);
    }
    String membersHTML=createMemberListingHTML(assessedMembers);
    convertToZipEntry(zout,"String_Node_Str",membersHTML);
    File sasstheme=new File(WebappHelper.getContextRealPath("String_Node_Str"));
    fsToZip(zout,sasstheme.toPath(),"String_Node_Str");
    File fontawesome=new File(WebappHelper.getContextRealPath("String_Node_Str"));
    fsToZip(zout,fontawesome.toPath(),"String_Node_Str");
    zout.close();
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
}