Program: 13443
Project: 13443
Buggy source:
/** 
 * Given a DITA map bounded object set, zips it up into a DXP Zip package.
 * @param mapBos
 * @param outputZipFile
 * @throws IOException 
 * @throws BosException 
 */
public static void zipMapBos(DitaBoundedObjectSet mapBos,File outputZipFile,DitaDxpOptions options) throws BosException, IOException {
  log.debug("String_Node_Str");
  BosVisitor visitor=new DxpFileOrganizingBosVisitor();
  visitor.visit(mapBos);
  if (!options.isQuiet())   log.info("String_Node_Str" + outputZipFile.getAbsolutePath() + "String_Node_Str");
  OutputStream outStream=new FileOutputStream(outputZipFile);
  ZipOutputStream zipOutStream=new ZipOutputStream(outStream);
  ZipEntry entry=null;
  URI rootMapUri=mapBos.getRoot().getEffectiveUri();
  URI baseUri=null;
  try {
    baseUri=AddressingUtil.getParent(rootMapUri);
  }
 catch (  URISyntaxException e) {
    throw new BosException("String_Node_Str" + e.getMessage());
  }
  Set<String> dirs=new HashSet<String>();
  if (!options.isQuiet())   log.info("String_Node_Str");
  for (  BosMember member : mapBos.getMembers()) {
    if (!options.isQuiet())     log.info("String_Node_Str" + member + "String_Node_Str");
    URI relativeUri=baseUri.relativize(member.getEffectiveUri());
    File temp=new File(relativeUri.getPath());
    String parentPath=temp.getParent();
    if (parentPath != null && !"String_Node_Str".equals(parentPath) && !parentPath.endsWith("String_Node_Str")) {
      parentPath+="String_Node_Str";
    }
    log.debug("String_Node_Str" + parentPath + "String_Node_Str");
    if (!"String_Node_Str".equals(parentPath) && parentPath != null && !dirs.contains(parentPath)) {
      entry=new ZipEntry(parentPath);
      zipOutStream.putNextEntry(entry);
      zipOutStream.closeEntry();
      dirs.add(parentPath);
    }
    entry=new ZipEntry(relativeUri.getPath());
    zipOutStream.putNextEntry(entry);
    IOUtils.copy(member.getInputStream(),zipOutStream);
    zipOutStream.closeEntry();
  }
  zipOutStream.close();
  if (!options.isQuiet())   log.info("String_Node_Str" + outputZipFile.getAbsolutePath() + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Given a DITA map bounded object set, zips it up into a DXP Zip package.
 * @param mapBos
 * @param outputZipFile
 * @throws IOException 
 * @throws BosException 
 */
public static void zipMapBos(DitaBoundedObjectSet mapBos,File outputZipFile,MapBosProcessorOptions options) throws BosException, IOException {
  log.debug("String_Node_Str");
  BosVisitor visitor=new DxpFileOrganizingBosVisitor();
  visitor.visit(mapBos);
  if (!options.isQuiet())   log.info("String_Node_Str" + outputZipFile.getAbsolutePath() + "String_Node_Str");
  OutputStream outStream=new FileOutputStream(outputZipFile);
  ZipOutputStream zipOutStream=new ZipOutputStream(outStream);
  ZipEntry entry=null;
  URI rootMapUri=mapBos.getRoot().getEffectiveUri();
  URI baseUri=null;
  try {
    baseUri=AddressingUtil.getParent(rootMapUri);
  }
 catch (  URISyntaxException e) {
    throw new BosException("String_Node_Str" + e.getMessage());
  }
  Set<String> dirs=new HashSet<String>();
  if (!options.isQuiet())   log.info("String_Node_Str");
  for (  BosMember member : mapBos.getMembers()) {
    if (!options.isQuiet())     log.info("String_Node_Str" + member + "String_Node_Str");
    URI relativeUri=baseUri.relativize(member.getEffectiveUri());
    File temp=new File(relativeUri.getPath());
    String parentPath=temp.getParent();
    if (parentPath != null && !"String_Node_Str".equals(parentPath) && !parentPath.endsWith("String_Node_Str")) {
      parentPath+="String_Node_Str";
    }
    log.debug("String_Node_Str" + parentPath + "String_Node_Str");
    if (!"String_Node_Str".equals(parentPath) && parentPath != null && !dirs.contains(parentPath)) {
      entry=new ZipEntry(parentPath);
      zipOutStream.putNextEntry(entry);
      zipOutStream.closeEntry();
      dirs.add(parentPath);
    }
    entry=new ZipEntry(relativeUri.getPath());
    zipOutStream.putNextEntry(entry);
    IOUtils.copy(member.getInputStream(),zipOutStream);
    zipOutStream.closeEntry();
  }
  zipOutStream.close();
  if (!options.isQuiet())   log.info("String_Node_Str" + outputZipFile.getAbsolutePath() + "String_Node_Str");
}