Program: 58497
Project: 58497
Buggy source:
@Test public void prepareCsv(){
  String xmlDir=System.getProperty("String_Node_Str");
  String csvDir=System.getProperty("String_Node_Str");
  List<String> ignoreType=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    if (xmlDir != null && csvDir != null) {
      File xDir=new File(xmlDir);
      File cDir=new File(csvDir);
      List<String[]> blankData=new ArrayList<String[]>();
      DocumentBuilderFactory dbFactory=DocumentBuilderFactory.newInstance();
      DocumentBuilder dBuilder=dbFactory.newDocumentBuilder();
      if (xDir.isDirectory() && cDir.isDirectory()) {
        for (        File xf : xDir.listFiles()) {
          LOG.info("String_Node_Str" + xf.getName());
          List<String> fieldList=new ArrayList<String>();
          Document doc=dBuilder.parse(xf);
          NodeList nList=doc.getElementsByTagName("String_Node_Str");
          String module=nList.item(0).getAttributes().getNamedItem("String_Node_Str").getNodeValue();
          nList=doc.getElementsByTagName("String_Node_Str");
          if (nList != null) {
            NodeList fields=nList.item(0).getChildNodes();
            Integer count=0;
            String csvFileName=module + "String_Node_Str" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL,xf.getName().replace("String_Node_Str","String_Node_Str"));
            while (count < fields.getLength()) {
              Node field=fields.item(count);
              NamedNodeMap attrs=field.getAttributes();
              String type=field.getNodeName();
              if (attrs != null && attrs.getNamedItem("String_Node_Str") != null && !ignoreType.contains(type)) {
                String fieldName=attrs.getNamedItem("String_Node_Str").getNodeValue();
                if (type.equals("String_Node_Str")) {
                  String[] objName=attrs.getNamedItem("String_Node_Str").getNodeValue().split("String_Node_Str");
                  String refName=objName[objName.length - 1];
                  String nameColumn=getNameColumn(xmlDir + "String_Node_Str" + refName+ "String_Node_Str");
                  if (nameColumn != null)                   fieldList.add(fieldName + "String_Node_Str" + nameColumn);
 else {
                    fieldList.add(fieldName);
                    LOG.error("String_Node_Str" + refName + "String_Node_Str"+ attrs.getNamedItem("String_Node_Str").getNodeValue()+ "String_Node_Str");
                  }
                }
 else                 fieldList.add(fieldName);
              }
              count++;
            }
            cTool.csvWriter(csvDir,csvFileName,';',StringUtils.join(fieldList,"String_Node_Str").split("String_Node_Str"),blankData);
            LOG.info("String_Node_Str" + csvFileName);
          }
        }
      }
 else       LOG.error("String_Node_Str");
    }
 else     LOG.error("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Test public void prepareCsv(){
  String xmlDir=System.getProperty("String_Node_Str");
  String csvDir=System.getProperty("String_Node_Str");
  List<String> ignoreType=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    if (xmlDir != null && csvDir != null) {
      File xDir=new File(xmlDir);
      File cDir=new File(csvDir);
      List<String[]> blankData=new ArrayList<String[]>();
      DocumentBuilderFactory dbFactory=DocumentBuilderFactory.newInstance();
      DocumentBuilder dBuilder=dbFactory.newDocumentBuilder();
      if (xDir.isDirectory() && cDir.isDirectory()) {
        for (        File xf : xDir.listFiles()) {
          LOG.info("String_Node_Str" + xf.getName());
          List<String> fieldList=new ArrayList<String>();
          Document doc=dBuilder.parse(xf);
          NodeList nList=doc.getElementsByTagName("String_Node_Str");
          String module=nList.item(0).getAttributes().getNamedItem("String_Node_Str").getNodeValue();
          nList=doc.getElementsByTagName("String_Node_Str");
          if (nList != null) {
            NodeList fields=nList.item(0).getChildNodes();
            Integer count=0;
            String csvFileName=module + "String_Node_Str" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL,xf.getName().replace("String_Node_Str","String_Node_Str"));
            while (count < fields.getLength()) {
              Node field=fields.item(count);
              NamedNodeMap attrs=field.getAttributes();
              String type=field.getNodeName();
              if (attrs != null && attrs.getNamedItem("String_Node_Str") != null && !ignoreType.contains(type)) {
                String fieldName=attrs.getNamedItem("String_Node_Str").getNodeValue();
                if (type.equals("String_Node_Str")) {
                  String[] objName=attrs.getNamedItem("String_Node_Str").getNodeValue().split("String_Node_Str");
                  String refName=objName[objName.length - 1];
                  String nameColumn=getNameColumn(xmlDir + "String_Node_Str" + refName+ "String_Node_Str");
                  if (nameColumn != null)                   fieldList.add(fieldName + "String_Node_Str" + nameColumn);
 else {
                    fieldList.add(fieldName);
                    LOG.error("String_Node_Str" + refName + "String_Node_Str"+ attrs.getNamedItem("String_Node_Str").getNodeValue()+ "String_Node_Str");
                  }
                }
 else                 fieldList.add(fieldName);
              }
              count++;
            }
            CsvTool.csvWriter(csvDir,csvFileName,';',StringUtils.join(fieldList,"String_Node_Str").split("String_Node_Str"),blankData);
            LOG.info("String_Node_Str" + csvFileName);
          }
        }
      }
 else       LOG.error("String_Node_Str");
    }
 else     LOG.error("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}