Program: 100851
Project: 100851
Buggy source:
private void processChunk(Element element,String outputFile){
  String hrefValue=element.getAttribute(ATTRIBUTE_NAME_HREF);
  String chunkValue=element.getAttribute(ATTRIBUTE_NAME_CHUNK);
  String copytoValue=element.getAttribute(ATTRIBUTE_NAME_COPY_TO);
  String scopeValue=element.getAttribute(ATTRIBUTE_NAME_SCOPE);
  String classValue=element.getAttribute(ATTRIBUTE_NAME_CLASS);
  String processRoleValue=element.getAttribute(ATTRIBUTE_NAME_PROCESSING_ROLE);
  String id=element.getAttribute(ATTRIBUTE_NAME_ID);
  String navtitle=element.getAttribute(ATTRIBUTE_NAME_NAVTITLE);
  String parseFilePath=null;
  String outputFileName=outputFile;
  Writer tempWriter=new StringWriter();
  Set<String> tempTopicID=new HashSet<String>();
  targetTopicId=null;
  selectMethod="String_Node_Str";
  include=false;
  boolean needWriteDitaTag=true;
  try {
    if (copytoValue.length() != 0 && !chunkValue.contains("String_Node_Str")) {
      if (hrefValue.indexOf(SHARP) != -1) {
        parseFilePath=copytoValue + hrefValue.substring(hrefValue.indexOf(SHARP));
      }
 else {
        parseFilePath=copytoValue;
      }
    }
 else {
      parseFilePath=hrefValue;
    }
    if (copytoValue.length() != 0 && chunkValue.contains("String_Node_Str") && !hrefValue.length() == 0) {
      copyto.add(copytoValue);
      if (hrefValue.indexOf(SHARP) != -1) {
        copytoSource.add(hrefValue.substring(0,hrefValue.indexOf(SHARP)));
        copytotarget2source.put(copytoValue,hrefValue.substring(0,hrefValue.indexOf(SHARP)));
      }
 else {
        copytoSource.add(hrefValue);
        copytotarget2source.put(copytoValue,hrefValue);
      }
    }
    if (!StringUtils.isEmptyString(classValue)) {
      if ((!classValue.contains(ATTR_CLASS_VALUE_TOPIC_GROUP)) && (!StringUtils.isEmptyString(parseFilePath)) && (!"String_Node_Str".equalsIgnoreCase(scopeValue))) {
        if (chunkValue.indexOf("String_Node_Str") != -1) {
          tempWriter=output;
          tempTopicID=topicID;
          output=new StringWriter();
          topicID=new HashSet<String>();
          if (classValue.contains(ATTR_CLASS_VALUE_MAP)) {
            outputFileName=FileUtils.resolveFile(filePath,parseFilePath);
            needWriteDitaTag=false;
          }
 else           if (copytoValue.length() != 0) {
            outputFileName=FileUtils.resolveFile(filePath,copytoValue);
          }
 else           if (hrefValue.length() != 0) {
            if (chunkValue.contains("String_Node_Str") || chunkValue.contains("String_Node_Str")) {
              if (hrefValue.contains(SHARP) && hrefValue.indexOf(SHARP) < hrefValue.length() - 1) {
                outputFileName=FileUtils.resolveFile(filePath,hrefValue.substring(hrefValue.indexOf(SHARP) + 1)) + ditaext;
              }
 else {
                String firstTopic=this.getFirstTopicId(FileUtils.resolveFile(filePath,hrefValue));
                if (!StringUtils.isEmptyString(firstTopic)) {
                  outputFileName=FileUtils.resolveFile(filePath,firstTopic) + ditaext;
                }
 else {
                  outputFileName=FileUtils.resolveFile(filePath,hrefValue);
                }
              }
            }
 else {
              outputFileName=FileUtils.resolveFile(filePath,hrefValue);
            }
          }
 else {
            Random random=new Random();
            outputFileName=FileUtils.resolveFile(filePath,"String_Node_Str" + random.nextInt(Integer.MAX_VALUE)) + ditaext;
          }
          if (FileUtils.fileExists(outputFileName) && !classValue.contains(ATTR_CLASS_VALUE_MAP)) {
            String t=outputFileName;
            Random random=new Random();
            outputFileName=FileUtils.resolveFile(filePath,"String_Node_Str" + random.nextInt(Integer.MAX_VALUE)) + ditaext;
            conflictTable.put(outputFileName,t);
          }
          changeTable.put(outputFileName,outputFileName);
        }
        this.outputFile=outputFileName;
{
          String path=FileUtils.resolveTopic(filePath,parseFilePath);
          String newpath=null;
          if (path.indexOf(SHARP) != -1) {
            newpath=outputFileName + path.substring(path.indexOf(SHARP));
          }
 else {
            String firstTopicID=this.getFirstTopicId(path);
            if (!StringUtils.isEmptyString(firstTopicID)) {
              newpath=outputFileName + "String_Node_Str" + firstTopicID;
            }
 else {
              newpath=outputFileName;
            }
          }
          changeTable.put(path,newpath);
          element.setAttribute(ATTRIBUTE_NAME_HREF,FileUtils.getRelativePathFromMap(filePath + SLASH + "String_Node_Str",newpath));
        }
        if (parseFilePath.indexOf(SHARP) != -1) {
          targetTopicId=parseFilePath.substring(parseFilePath.indexOf(SHARP) + 1);
        }
        if (chunkValue.indexOf("String_Node_Str") != -1) {
          int endIndex=chunkValue.indexOf(STRING_BLANK,chunkValue.indexOf("String_Node_Str"));
          if (endIndex == -1) {
            selectMethod=chunkValue.substring(chunkValue.indexOf("String_Node_Str"));
          }
 else {
            selectMethod=chunkValue.substring(chunkValue.indexOf("String_Node_Str"),endIndex);
          }
          if ("String_Node_Str".equals(selectMethod) || "String_Node_Str".equals(selectMethod)) {
            if (targetTopicId == null) {
              selectMethod="String_Node_Str";
            }
          }
        }
        String tempPath=currentParsingFile;
        currentParsingFile=FileUtils.resolveFile(filePath,parseFilePath);
        if (!ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equalsIgnoreCase(processRoleValue)) {
          currentParsingFileTopicIDChangeTable=new HashMap<String,String>();
          reader.parse(currentParsingFile);
          if (currentParsingFileTopicIDChangeTable.size() > 0) {
            String href=element.getAttribute(ATTRIBUTE_NAME_HREF);
            href=href.replaceAll(DOUBLE_BACK_SLASH,SLASH);
            String pathtoElem=href.contains(SHARP) ? href.substring(href.indexOf(SHARP) + 1) : "String_Node_Str";
            String old_elementid=pathtoElem.contains(SLASH) ? pathtoElem.substring(0,pathtoElem.indexOf(SLASH)) : pathtoElem;
            if (old_elementid.length() > 0) {
              String new_elementid=currentParsingFileTopicIDChangeTable.get(old_elementid);
              if (new_elementid != null && new_elementid.length() > 0) {
                href=href.replaceFirst(SHARP + old_elementid,SHARP + new_elementid);
                element.setAttribute(ATTRIBUTE_NAME_HREF,href);
              }
            }
          }
          currentParsingFileTopicIDChangeTable=null;
        }
        currentParsingFile=tempPath;
      }
      if (outputFileName == null) {
        if (!StringUtils.isEmptyString(copytoValue)) {
          outputFileName=FileUtils.resolveFile(filePath,copytoValue);
        }
 else         if (!StringUtils.isEmptyString(id)) {
          outputFileName=FileUtils.resolveFile(filePath,id + ditaext);
        }
 else {
          Random random=new Random();
          outputFileName=FileUtils.resolveFile(filePath,"String_Node_Str" + random.nextInt(Integer.MAX_VALUE)) + ditaext;
          if (FileUtils.fileExists(outputFileName) && !classValue.contains(ATTR_CLASS_VALUE_MAP)) {
            String t=outputFileName;
            outputFileName=FileUtils.resolveFile(filePath,"String_Node_Str" + random.nextInt(Integer.MAX_VALUE)) + ditaext;
            conflictTable.put(outputFileName,t);
          }
        }
        if (element.hasChildNodes() || !StringUtils.isEmptyString(navtitle)) {
          DITAAttrUtils utils=DITAAttrUtils.getInstance();
          String navtitleValue=null;
          String shortDescValue=null;
          navtitleValue=utils.getChildElementValueOfTopicmeta(element,ATTR_CLASS_VALUE_NAVTITLE);
          shortDescValue=utils.getChildElementValueOfTopicmeta(element,ATTR_CLASS_VALUE_MAP_SHORTDESC);
          if (navtitleValue == null) {
            navtitleValue=navtitle;
          }
          changeTable.put(outputFileName,outputFileName);
          if (!StringUtils.isEmptyString(navtitleValue)) {
            element.setAttribute(ATTRIBUTE_NAME_HREF,FileUtils.getRelativePathFromMap(filePath + SLASH + "String_Node_Str",outputFileName));
            StringBuffer buffer=new StringBuffer();
            buffer.append("String_Node_Str").append("String_Node_Str").append(navtitleValue).append("String_Node_Str");
            if (shortDescValue != null) {
              buffer.append("String_Node_Str").append(shortDescValue).append("String_Node_Str");
            }
            buffer.append("String_Node_Str");
            StringReader rder=new StringReader(buffer.toString());
            InputSource source=new InputSource(rder);
            String tempPath=currentParsingFile;
            currentParsingFile=outputFileName;
            parseFilePath=outputFileName;
            reader.parse(source);
            currentParsingFile=tempPath;
          }
        }
      }
      if (element.hasChildNodes()) {
        StringWriter temp=(StringWriter)output;
        output=new StringWriter();
        NodeList children=element.getChildNodes();
        for (int i=0; i < children.getLength(); i++) {
          Node current=children.item(i);
          if (current.getNodeType() == Node.ELEMENT_NODE && ((Element)current).getAttribute(ATTRIBUTE_NAME_CLASS).indexOf(ATTR_CLASS_VALUE_TOPICREF) != -1) {
            processChunk((Element)current,outputFileName);
          }
        }
        StringBuffer parentResult=temp.getBuffer();
        if (parentResult.length() > 0 && !StringUtils.isEmptyString(parseFilePath) && !ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equalsIgnoreCase(processRoleValue)) {
          int insertpoint=parentResult.lastIndexOf("String_Node_Str");
          int end=parentResult.indexOf("String_Node_Str",insertpoint);
          if (insertpoint == -1 || end == -1) {
            Properties prop=new Properties();
            prop.put("String_Node_Str",hrefValue);
            logger.logError(MessageUtils.getMessage("String_Node_Str",prop).toString());
          }
 else {
            if (ELEMENT_NAME_DITA.equalsIgnoreCase(parentResult.substring(insertpoint,end).trim())) {
              insertpoint=parentResult.lastIndexOf("String_Node_Str",insertpoint);
            }
            parentResult.insert(insertpoint,((StringWriter)output).getBuffer());
          }
        }
 else {
          parentResult.append(((StringWriter)output).getBuffer());
        }
        output=temp;
      }
      if (chunkValue.indexOf("String_Node_Str") != -1) {
        FileOutputStream fileOutput=new FileOutputStream(outputFileName);
        OutputStreamWriter ditaFileOutput=null;
        try {
          ditaFileOutput=new OutputStreamWriter(fileOutput,UTF8);
          if (outputFileName.equals(changeTable.get(outputFileName))) {
            ditaFileOutput.write(XML_HEAD);
            if (OS_NAME.toLowerCase().indexOf(OS_NAME_WINDOWS) == -1) {
              ditaFileOutput.write(PI_WORKDIR_HEAD + new File(outputFileName).getParent() + PI_END);
            }
 else {
              ditaFileOutput.write(PI_WORKDIR_HEAD + SLASH + new File(outputFileName).getParent()+ PI_END);
            }
            if ((conflictTable.get(outputFileName) != null)) {
              String relativePath=FileUtils.getRelativePathFromMap(filePath + SLASH + "String_Node_Str",conflictTable.get(outputFileName));
              String path2project=FileUtils.getPathtoProject(relativePath);
              if (null == path2project) {
                path2project="String_Node_Str";
              }
              ditaFileOutput.write("String_Node_Str" + path2project + "String_Node_Str");
            }
          }
          if (needWriteDitaTag)           ditaFileOutput.write("String_Node_Str");
          ditaFileOutput.write(((StringWriter)output).getBuffer().toString());
          if (needWriteDitaTag)           ditaFileOutput.write("String_Node_Str");
          ditaFileOutput.flush();
        }
  finally {
          ditaFileOutput.close();
        }
        output=tempWriter;
        topicID=tempTopicID;
      }
    }
  }
 catch (  Exception e) {
    logger.logException(e);
  }
}

Fixed version (ground truth):
private void processChunk(Element element,String outputFile){
  String hrefValue=element.getAttribute(ATTRIBUTE_NAME_HREF);
  String chunkValue=element.getAttribute(ATTRIBUTE_NAME_CHUNK);
  String copytoValue=element.getAttribute(ATTRIBUTE_NAME_COPY_TO);
  String scopeValue=element.getAttribute(ATTRIBUTE_NAME_SCOPE);
  String classValue=element.getAttribute(ATTRIBUTE_NAME_CLASS);
  String processRoleValue=element.getAttribute(ATTRIBUTE_NAME_PROCESSING_ROLE);
  String id=element.getAttribute(ATTRIBUTE_NAME_ID);
  String navtitle=element.getAttribute(ATTRIBUTE_NAME_NAVTITLE);
  String parseFilePath=null;
  String outputFileName=outputFile;
  Writer tempWriter=new StringWriter();
  Set<String> tempTopicID=new HashSet<String>();
  targetTopicId=null;
  selectMethod="String_Node_Str";
  include=false;
  boolean needWriteDitaTag=true;
  try {
    if (copytoValue.length() != 0 && !chunkValue.contains("String_Node_Str")) {
      if (hrefValue.indexOf(SHARP) != -1) {
        parseFilePath=copytoValue + hrefValue.substring(hrefValue.indexOf(SHARP));
      }
 else {
        parseFilePath=copytoValue;
      }
    }
 else {
      parseFilePath=hrefValue;
    }
    if (copytoValue.length() != 0 && chunkValue.contains("String_Node_Str") && hrefValue.length() != 0) {
      copyto.add(copytoValue);
      if (hrefValue.indexOf(SHARP) != -1) {
        copytoSource.add(hrefValue.substring(0,hrefValue.indexOf(SHARP)));
        copytotarget2source.put(copytoValue,hrefValue.substring(0,hrefValue.indexOf(SHARP)));
      }
 else {
        copytoSource.add(hrefValue);
        copytotarget2source.put(copytoValue,hrefValue);
      }
    }
    if (!StringUtils.isEmptyString(classValue)) {
      if ((!classValue.contains(ATTR_CLASS_VALUE_TOPIC_GROUP)) && (!StringUtils.isEmptyString(parseFilePath)) && (!"String_Node_Str".equalsIgnoreCase(scopeValue))) {
        if (chunkValue.indexOf("String_Node_Str") != -1) {
          tempWriter=output;
          tempTopicID=topicID;
          output=new StringWriter();
          topicID=new HashSet<String>();
          if (classValue.contains(ATTR_CLASS_VALUE_MAP)) {
            outputFileName=FileUtils.resolveFile(filePath,parseFilePath);
            needWriteDitaTag=false;
          }
 else           if (copytoValue.length() != 0) {
            outputFileName=FileUtils.resolveFile(filePath,copytoValue);
          }
 else           if (hrefValue.length() != 0) {
            if (chunkValue.contains("String_Node_Str") || chunkValue.contains("String_Node_Str")) {
              if (hrefValue.contains(SHARP) && hrefValue.indexOf(SHARP) < hrefValue.length() - 1) {
                outputFileName=FileUtils.resolveFile(filePath,hrefValue.substring(hrefValue.indexOf(SHARP) + 1)) + ditaext;
              }
 else {
                String firstTopic=this.getFirstTopicId(FileUtils.resolveFile(filePath,hrefValue));
                if (!StringUtils.isEmptyString(firstTopic)) {
                  outputFileName=FileUtils.resolveFile(filePath,firstTopic) + ditaext;
                }
 else {
                  outputFileName=FileUtils.resolveFile(filePath,hrefValue);
                }
              }
            }
 else {
              outputFileName=FileUtils.resolveFile(filePath,hrefValue);
            }
          }
 else {
            Random random=new Random();
            outputFileName=FileUtils.resolveFile(filePath,"String_Node_Str" + random.nextInt(Integer.MAX_VALUE)) + ditaext;
          }
          if (FileUtils.fileExists(outputFileName) && !classValue.contains(ATTR_CLASS_VALUE_MAP)) {
            String t=outputFileName;
            Random random=new Random();
            outputFileName=FileUtils.resolveFile(filePath,"String_Node_Str" + random.nextInt(Integer.MAX_VALUE)) + ditaext;
            conflictTable.put(outputFileName,t);
          }
          changeTable.put(outputFileName,outputFileName);
        }
        this.outputFile=outputFileName;
{
          String path=FileUtils.resolveTopic(filePath,parseFilePath);
          String newpath=null;
          if (path.indexOf(SHARP) != -1) {
            newpath=outputFileName + path.substring(path.indexOf(SHARP));
          }
 else {
            String firstTopicID=this.getFirstTopicId(path);
            if (!StringUtils.isEmptyString(firstTopicID)) {
              newpath=outputFileName + "String_Node_Str" + firstTopicID;
            }
 else {
              newpath=outputFileName;
            }
          }
          changeTable.put(path,newpath);
          element.setAttribute(ATTRIBUTE_NAME_HREF,FileUtils.getRelativePathFromMap(filePath + SLASH + "String_Node_Str",newpath));
        }
        if (parseFilePath.indexOf(SHARP) != -1) {
          targetTopicId=parseFilePath.substring(parseFilePath.indexOf(SHARP) + 1);
        }
        if (chunkValue.indexOf("String_Node_Str") != -1) {
          int endIndex=chunkValue.indexOf(STRING_BLANK,chunkValue.indexOf("String_Node_Str"));
          if (endIndex == -1) {
            selectMethod=chunkValue.substring(chunkValue.indexOf("String_Node_Str"));
          }
 else {
            selectMethod=chunkValue.substring(chunkValue.indexOf("String_Node_Str"),endIndex);
          }
          if ("String_Node_Str".equals(selectMethod) || "String_Node_Str".equals(selectMethod)) {
            if (targetTopicId == null) {
              selectMethod="String_Node_Str";
            }
          }
        }
        String tempPath=currentParsingFile;
        currentParsingFile=FileUtils.resolveFile(filePath,parseFilePath);
        if (!ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equalsIgnoreCase(processRoleValue)) {
          currentParsingFileTopicIDChangeTable=new HashMap<String,String>();
          reader.parse(currentParsingFile);
          if (currentParsingFileTopicIDChangeTable.size() > 0) {
            String href=element.getAttribute(ATTRIBUTE_NAME_HREF);
            href=href.replaceAll(DOUBLE_BACK_SLASH,SLASH);
            String pathtoElem=href.contains(SHARP) ? href.substring(href.indexOf(SHARP) + 1) : "String_Node_Str";
            String old_elementid=pathtoElem.contains(SLASH) ? pathtoElem.substring(0,pathtoElem.indexOf(SLASH)) : pathtoElem;
            if (old_elementid.length() > 0) {
              String new_elementid=currentParsingFileTopicIDChangeTable.get(old_elementid);
              if (new_elementid != null && new_elementid.length() > 0) {
                href=href.replaceFirst(SHARP + old_elementid,SHARP + new_elementid);
                element.setAttribute(ATTRIBUTE_NAME_HREF,href);
              }
            }
          }
          currentParsingFileTopicIDChangeTable=null;
        }
        currentParsingFile=tempPath;
      }
      if (outputFileName == null) {
        if (!StringUtils.isEmptyString(copytoValue)) {
          outputFileName=FileUtils.resolveFile(filePath,copytoValue);
        }
 else         if (!StringUtils.isEmptyString(id)) {
          outputFileName=FileUtils.resolveFile(filePath,id + ditaext);
        }
 else {
          Random random=new Random();
          outputFileName=FileUtils.resolveFile(filePath,"String_Node_Str" + random.nextInt(Integer.MAX_VALUE)) + ditaext;
          if (FileUtils.fileExists(outputFileName) && !classValue.contains(ATTR_CLASS_VALUE_MAP)) {
            String t=outputFileName;
            outputFileName=FileUtils.resolveFile(filePath,"String_Node_Str" + random.nextInt(Integer.MAX_VALUE)) + ditaext;
            conflictTable.put(outputFileName,t);
          }
        }
        if (element.hasChildNodes() || !StringUtils.isEmptyString(navtitle)) {
          DITAAttrUtils utils=DITAAttrUtils.getInstance();
          String navtitleValue=null;
          String shortDescValue=null;
          navtitleValue=utils.getChildElementValueOfTopicmeta(element,ATTR_CLASS_VALUE_NAVTITLE);
          shortDescValue=utils.getChildElementValueOfTopicmeta(element,ATTR_CLASS_VALUE_MAP_SHORTDESC);
          if (navtitleValue == null) {
            navtitleValue=navtitle;
          }
          changeTable.put(outputFileName,outputFileName);
          if (!StringUtils.isEmptyString(navtitleValue)) {
            element.setAttribute(ATTRIBUTE_NAME_HREF,FileUtils.getRelativePathFromMap(filePath + SLASH + "String_Node_Str",outputFileName));
            StringBuffer buffer=new StringBuffer();
            buffer.append("String_Node_Str").append("String_Node_Str").append(navtitleValue).append("String_Node_Str");
            if (shortDescValue != null) {
              buffer.append("String_Node_Str").append(shortDescValue).append("String_Node_Str");
            }
            buffer.append("String_Node_Str");
            StringReader rder=new StringReader(buffer.toString());
            InputSource source=new InputSource(rder);
            String tempPath=currentParsingFile;
            currentParsingFile=outputFileName;
            parseFilePath=outputFileName;
            reader.parse(source);
            currentParsingFile=tempPath;
          }
        }
      }
      if (element.hasChildNodes()) {
        StringWriter temp=(StringWriter)output;
        output=new StringWriter();
        NodeList children=element.getChildNodes();
        for (int i=0; i < children.getLength(); i++) {
          Node current=children.item(i);
          if (current.getNodeType() == Node.ELEMENT_NODE && ((Element)current).getAttribute(ATTRIBUTE_NAME_CLASS).indexOf(ATTR_CLASS_VALUE_TOPICREF) != -1) {
            processChunk((Element)current,outputFileName);
          }
        }
        StringBuffer parentResult=temp.getBuffer();
        if (parentResult.length() > 0 && !StringUtils.isEmptyString(parseFilePath) && !ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY.equalsIgnoreCase(processRoleValue)) {
          int insertpoint=parentResult.lastIndexOf("String_Node_Str");
          int end=parentResult.indexOf("String_Node_Str",insertpoint);
          if (insertpoint == -1 || end == -1) {
            Properties prop=new Properties();
            prop.put("String_Node_Str",hrefValue);
            logger.logError(MessageUtils.getMessage("String_Node_Str",prop).toString());
          }
 else {
            if (ELEMENT_NAME_DITA.equalsIgnoreCase(parentResult.substring(insertpoint,end).trim())) {
              insertpoint=parentResult.lastIndexOf("String_Node_Str",insertpoint);
            }
            parentResult.insert(insertpoint,((StringWriter)output).getBuffer());
          }
        }
 else {
          parentResult.append(((StringWriter)output).getBuffer());
        }
        output=temp;
      }
      if (chunkValue.indexOf("String_Node_Str") != -1) {
        FileOutputStream fileOutput=new FileOutputStream(outputFileName);
        OutputStreamWriter ditaFileOutput=null;
        try {
          ditaFileOutput=new OutputStreamWriter(fileOutput,UTF8);
          if (outputFileName.equals(changeTable.get(outputFileName))) {
            ditaFileOutput.write(XML_HEAD);
            if (OS_NAME.toLowerCase().indexOf(OS_NAME_WINDOWS) == -1) {
              ditaFileOutput.write(PI_WORKDIR_HEAD + new File(outputFileName).getParent() + PI_END);
            }
 else {
              ditaFileOutput.write(PI_WORKDIR_HEAD + SLASH + new File(outputFileName).getParent()+ PI_END);
            }
            if ((conflictTable.get(outputFileName) != null)) {
              String relativePath=FileUtils.getRelativePathFromMap(filePath + SLASH + "String_Node_Str",conflictTable.get(outputFileName));
              String path2project=FileUtils.getPathtoProject(relativePath);
              if (null == path2project) {
                path2project="String_Node_Str";
              }
              ditaFileOutput.write("String_Node_Str" + path2project + "String_Node_Str");
            }
          }
          if (needWriteDitaTag)           ditaFileOutput.write("String_Node_Str");
          ditaFileOutput.write(((StringWriter)output).getBuffer().toString());
          if (needWriteDitaTag)           ditaFileOutput.write("String_Node_Str");
          ditaFileOutput.flush();
        }
  finally {
          ditaFileOutput.close();
        }
        output=tempWriter;
        topicID=tempTopicID;
      }
    }
  }
 catch (  Exception e) {
    logger.logException(e);
  }
}